StylePropertyMap: clear() Methode
Eingeschränkt verfügbar
Diese Funktion ist nicht Baseline, da sie in einigen der am weitesten verbreiteten Browser nicht funktioniert.
Want more browser support for this feature? Tell us why.
Die clear()-Methode der StylePropertyMap-Schnittstelle entfernt alle Deklarationen im StylePropertyMap.
Syntax
js
clear()
Parameter
Keine.
Rückgabewert
Keiner (undefined).
Beispiele
Das folgende Beispiel entfernt alle Stile innerhalb der Elemente style-Attribut.
js
// get the button element
const buttonEl = document.querySelector(".example");
// remove all styles from the style attribute
buttonEl.attributeStyleMap.clear();
Spezifikationen
| Spezifikation |
|---|
| CSS Typed OM Level 1> # dom-stylepropertymap-clear> |