StylePropertyMap: clear() method - Web APIs | MDN

Syntax

Parameters

None.

Return value

None (undefined).

Examples

The following example removes all styles within the elements style attribute.

js

// get the button element
const buttonEl = document.querySelector(".example");

// remove all styles from the style attribute
buttonEl.attributeStyleMap.clear();

Specifications

Specification
CSS Typed OM Level 1
# dom-stylepropertymap-clear

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.