JavaScript CSSStyleDeclaration 對(duì)象
removeProperty()方法移除CSS樣式聲明對(duì)象的屬性。
object.removeProperty(property)
var declaration = document.styleSheets[0].rules[0].style;
var oldValue = declaration.removeProperty('color');
document.getElementById("result").innerHTML = oldValue;測(cè)試看看?/?所有瀏覽器都完全支持removeProperty()方法:
| Method | ![]() | ![]() | ![]() | ![]() | ![]() |
| removeProperty() | 是 | 是 | 是 | 是 | 是 |
| 參數(shù) | 描述 |
|---|---|
| property | 一個(gè)字符串,表示要?jiǎng)h除的屬性的名稱 |
| 返回值: | 一個(gè)字符串,表示已刪除屬性的舊值 |
|---|---|
| DOM版本: | CSS對(duì)象模型 |