StylePropertyMap: append()-Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die append()
-Methode der StylePropertyMap
-Schnittstelle fügt den übergebenen CSS-Wert mit der angegebenen Eigenschaft zum StylePropertyMap
hinzu.
Syntax
js
append(property, value)
Parameter
Rückgabewert
Keiner (undefined
).
Beispiele
Dieses Beispiel zeigt, wie ein zusätzlicher Hintergrundbildwert zur background-image
-Eigenschaft des Elements hinzugefügt wird, unter Verwendung von HTMLElement.attributeStyleMap
.
js
// get the button element
const buttonEl = document.querySelector("button");
// append another value to the background-image property set on the attribute
buttonEl.attributeStyleMap.append(
"background-image",
"linear-gradient(180deg, blue, black)",
);
Spezifikationen
Specification |
---|
CSS Typed OM Level 1 # dom-stylepropertymap-append |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
append |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.