JavaScript CSSStyleDeclaration 对象
removeProperty()方法移除CSS样式声明对象的属性。
object.removeProperty(property)
var declaration = document.styleSheets[0].rules[0].style;
var oldValue = declaration.removeProperty('color');
document.getElementById("result").innerHTML = oldValue;测试看看‹/›所有浏览器都完全支持removeProperty()方法:
| Method | ![]() | ![]() | ![]() | ![]() | ![]() |
| removeProperty() | 是 | 是 | 是 | 是 | 是 |
| 参数 | 描述 |
|---|---|
| property | 一个字符串,表示要删除的属性的名称 |
| 返回值: | 一个字符串,表示已删除属性的旧值 |
|---|---|
| DOM版本: | CSS对象模型 |