StylePropertyMap: delete()-Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die delete()
-Methode der StylePropertyMap
-Schnittstelle entfernt die CSS-Deklaration mit der angegebenen Eigenschaft.
Syntax
js
delete(property)
Parameter
property
-
Ein Bezeichner, der das stilistische Merkmal angibt (z.B. Schriftart, Breite, Hintergrundfarbe), das entfernt werden soll.
Rückgabewert
Keiner (undefined
).
Beispiele
Das folgende Beispiel entfernt die background-image
-Eigenschaft aus dem style-Attribut des Elements.
js
// get the button element
const buttonEl = document.querySelector("button");
// remove background-image from style attribute
buttonEl.attributeStyleMap.delete("background-image");
Spezifikationen
Specification |
---|
CSS Typed OM Level 1 # dom-stylepropertymap-delete |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
delete |
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.