StylePropertyMapReadOnly.size
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
size
は StylePropertyMapReadOnly
インターフェイスの読み取り専用プロパティで、 StylePropertyMapReadOnly
オブジェクトの大きさを符号なし長整数で返します。
構文
js
var size = StylePropertyMapReadOnly.size;
値
符号なし長整数です。
例
ここでは size プロパティを使用して、この button 要素の computedStyleMap
に含まれる項目の数を返します。
js
// 要素を取得
const buttonEl = document.querySelector("button");
// `computedStyleMap` ですべての計算済みスタイルが取得できます
const allComputedStyles = buttonEl.computedStyleMap();
// size を使用してマップ内にあるスタイルの数を取得します
const amountStyles = allComputedStyles.size;
console.log(amountStyles); // 338 と表示
仕様書
Specification |
---|
CSS Typed OM Level 1 # dom-stylepropertymapreadonly-size |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
size |
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.