CSS Typed Object Model API
The clear() method of the StylePropertyMap interface removes all declarations in the StylePropertyMap.
Syntax
clear()
Parameters
None.
Return value
None (undefined).
Examples
Basic usage
The following example removes all styles within the elements style attribute.
// get the button element
const buttonEl = document.querySelector(".example");
// remove all styles from the style attribute
buttonEl.attributeStyleMap.clear();
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
