CSSStyleValue: parse() 静的メソッド
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
parse()
は CSSStyleValue
インターフェイスのメソッドで、特定の CSS プロパティを指定された値に設定し、最初の値を CSSStyleValue
オブジェクトとして返します。
構文
js
CSSStyleValue.parse(property, cssText)
引数
返値
最初に与えられた値を格納した CSSStyleValue
オブジェクトです。
例
下記のコードは transform
プロパティに対する一連の宣言を解釈します。
2 つ目のコードブロックは、返されたオブジェクトの構造を、開発者ツールのコンソールに表示したものです。
js
const css = CSSStyleValue.parse(
"transform",
"translate3d(10px,10px,0) scale(0.5)",
);
css
CSSTransformValue {0: CSSTranslate, 1: CSSScale, length: 2, is2D: false}
仕様書
Specification |
---|
CSS Typed OM Level 1 # dom-cssstylevalue-parse |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
parse() static method |
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.