HTML:标记语言
CSS:样式语言
JavaScript:脚本语言
Web API:编程接口
所有 Web 技术
学习 Web 开发
发现我们的工具
更好地了解 MDN
此特性不是基线特性,因为它在一些最广泛使用的浏览器中不起作用。
StylePropertyMap 接口的 clear() 方法移除 StylePropertyMap 中的所有声明。
StylePropertyMap
clear()
无。
无(undefined)。
undefined
以下示例移除了元素 style 属性中的所有样式。
// get the button element const buttonEl = document.querySelector(".example"); // remove all styles from the style attribute buttonEl.attributeStyleMap.clear();
加载中…