StylePropertyMap: delete() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thedelete()
method of theStylePropertyMap
interface removes the CSS declaration with the givenproperty.
In this article
Syntax
js
delete(property)
Parameters
property
An identifier indicating the stylistic feature (e.g., font, width, backgroundcolor) to remove.
Return value
None (undefined
).
Examples
The following example removes thebackground-image
property from theelement'sstyle attribute.
js
// get the button elementconst buttonEl = document.querySelector("button");// remove background-image from style attributebuttonEl.attributeStyleMap.delete("background-image");
Specifications
Specification |
---|
CSS Typed OM Level 1> # dom-stylepropertymap-delete> |
Browser compatibility
Loading…