StylePropertyMap: set() Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die set() Methode der StylePropertyMap-Schnittstelle ändert die CSS-Deklaration mit der angegebenen Eigenschaft.
Syntax
js
set(property, value)
Parameter
Rückgabewert
Kein Wert (undefined).
Beispiele
Dieses Beispiel setzt die padding-top-Eigenschaft mit dem angegebenen Wert im style-Attribut des Elements.
js
// get the button element
const buttonEl = document.querySelector("button");
// set padding-top on button style attribute
buttonEl.attributeStyleMap.set("padding-top", CSS.px(10));
Spezifikationen
| Specification |
|---|
| CSS Typed OM Level 1> # dom-stylepropertymap-set> |
Browser-Kompatibilität
Loading…