语法
js
delete(property)
参数
property(属性)-
一个标识符,指示要移除的样式功能(例如,font、width、background color)。
返回值
无(undefined)。
示例
以下示例从元素的 style attribute 中移除 background-image 属性。
js
// get the button element
const buttonEl = document.querySelector("button");
// remove background-image from style attribute
buttonEl.attributeStyleMap.delete("background-image");
规范
| 规范 |
|---|
| CSS 类型化 OM Level 1 # dom-stylepropertymap-delete |
浏览器兼容性
加载中…