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()Yes9.0YesYesYes

语法

object.removeProperty(propertyname)

属性值

参数描述
propertyname必需。一个字符串,表示要移除的属性名。

技术细节

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

CSS CSSStyleDeclaration CSS CSSStyleDeclaration

0 个评论

要回复文章请先登录注册