Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CSSKeywordValue

CSSKeywordValue

Limited availability

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

TheCSSKeywordValue interface of theCSS Typed Object Model API creates an object to represent CSS keywords and other identifiers.

The interface instance name is astringifier meaning that when used anywhere a string is expected it will return the value ofCSSKeyword.value.

CSSStyleValue CSSKeywordValue

Constructor

CSSKeywordValue()

Creates a newCSSKeywordValue object.

Instance properties

CSSKeywordValue.value

Returns or sets the value of theCSSKeywordValue.

Instance methods

Inherits methods fromCSSStyleValue.

Examples

The following example resets the CSSdisplay property to its defaults, setting the inlinestyle attribute tostyle="display: initial" if viewed in thedeveloper tools inspector.

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

Specifications

Specification
CSS Typed OM Level 1
# keywordvalue-objects

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp