CSSKeywordValue
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
CSSKeywordValue
は CSS 型付きオブジェクトモデル API のインターフェイスで、CSS のキーワードやその他の識別子を表すオブジェクトを作成します。
このインターフェイスのインスタンス名は文字列化子です。つまり、文字列が期待される場所で使用すると CSSKeyword.value
の値を返します。
コンストラクター
CSSKeywordValue()
-
新しい
CSSKeywordValue
オブジェクトを生成します。
インスタンスプロパティ
CSSKeywordValue.value
-
CSSKeywordValue
の値を返却または設定します。
インスタンスメソッド
CSSStyleValue
からメソッドを継承しています。
例
次の例は、CSS の display
プロパティを既定値にリセットするために、インラインの style
属性を style="display: initial"
に設定します。これは開発者ツールインスペクターで見られます。
js
let myElement = document.getElementById("myElement").attributeStyleMap;
myElement.set("display", new CSSKeywordValue("initial"));
console.log(myElement.get("display").value); // 'initial'
仕様書
Specification |
---|
CSS Typed OM Level 1 # keywordvalue-objects |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CSSKeywordValue | ||||||||||||
CSSKeywordValue() constructor | ||||||||||||
value |
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.