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();
載入中…