A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/StylePropertyMap/clear below:

StylePropertyMap: clear() method - Web APIs

MDN Web Docs
  1. Web
  2. Web APIs
  3. StylePropertyMap
  4. clear()

Filter sidebar

In this article
  1. CSS Typed Object Model API
  2. StylePropertyMap
  3. Instance methods
    1. append()
    2. clear()
    3. delete()
    4. set()
  4. Inheritance
    1. StylePropertyMapReadOnly
  5. Related pages for CSS Typed Object Model API
    1. CSSImageValue
    2. CSSKeywordValue
    3. CSSNumericValue
    4. CSSPositionValue Non-standard Deprecated
    5. CSSStyleValue
    6. CSSTransformValue
    7. CSSUnparsedValue
  6. Guides
    1. Using the CSS Typed Object Model
In this article StylePropertyMap: clear() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The clear() method of the StylePropertyMap interface removes all declarations in the StylePropertyMap.

Syntax

js

clear()
Parameters

None.

Return value

None (undefined).

Examples

The following example removes all styles within the elements style attribute.

js

// get the button element
const buttonEl = document.querySelector(".example");

// remove all styles from the style attribute
buttonEl.attributeStyleMap.clear();
Specifications Specification CSS Typed OM Level 1
# dom-stylepropertymap-clear
Browser compatibility Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on Apr 10, 2025 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4