CSSStyleDeclaration removeProperty() 方法

CSS CSSStyleDeclaration CSS CSSStyleDeclaration

實例

移除 color 屬性:

var declaration = document.styleSheets[0].cssRules[0].style; var removedvalue = declaration.removeProperty("color"); alert(removedvalue);


定義和使用

removeProperty() 方法用於移除指定的 CSS 樣式屬性。


流覽器支持

方法
removeProperty() Yes 9.0 Yes Yes Yes

語法

object.removeProperty(propertyname)

屬性值

參數 描述
propertyname 必需。一個字串,表示要移除的屬性名。

技術細節

DOM 版本: CSS Object Model
返回值: 字串, 是移除的屬性名。

CSS CSSStyleDeclaration CSS CSSStyleDeclaration