Firefox Tomorrow

web api instance method

StylePropertyMap: clear() method

View on MDN ↗

The clear() method of the StylePropertyMap interface removes all declarations in the StylePropertyMap.

Syntax

clear()

Parameters

None.

Return value

None (undefined).

Examples

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

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.