A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/CSSKeywordValue/CSSKeywordValue below:

CSSKeywordValue: CSSKeywordValue() constructor - Web APIs

CSSKeywordValue: CSSKeywordValue() constructor

Limited availability

The CSSKeywordValue() constructor creates a new CSSKeywordValue object which represents CSS keywords and other identifiers.

Syntax Parameters
value

Sets or returns the value of the new CSSKeywordValue.

Exceptions
TypeError

Thrown if the value parameter is not specified or it is not of type String.

Examples

The following example resets the CSS display property to its defaults, setting the inline style attribute to style="display: initial" if viewed in the developer tools inspector.

#myElement {
  display: flex;
}
<div id="myElement">
  Check the developer tools to see the log in the console and to inspect the
  style attribute on this div.
</div>
const keyword = new CSSKeywordValue("initial");
const myElement = document.getElementById("myElement").attributeStyleMap;
myElement.set("display", keyword);

console.log(myElement.get("display").value); // 'initial'
console.dir(keyword);
Specifications Browser compatibility

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