StylePropertyMapReadOnly.entries()

Limited availability

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

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

StylePropertyMapReadOnly.entries() メソッドは、このオブジェクトが持つ列挙可能なプロパティの [key, value] の組の配列を、 for...in ループで提供されるのと同じ順序で返します(違いは for-in ループではプロトタイプチェーン内のプロパティも列挙する点です)。

構文

js
StylePropertyMapReadOnly.entries();

引数

なし。

返値

この StylePropertyMapReadOnly オブジェクトが持つ列挙可能な [key, value] の組の配列です。

こちらは、 StylePropertyMapReadOnly.entries() メソッドを使用して要素の計算済みスタイルを取得する例です。

js
// DOM 要素を取得
const buttonEl = document.querySelector("button");

// `computedStyleMap` ですべての計算済みスタイルが取得できます
const allComputedStyles = buttonEl.computedStyleMap();

// entries は項目の反復可能オブジェクトを返します
const iterableStyles = allComputedStyles.entries();

// align-content を最初の項目、 CSSStyleValue を 2 番目の項目とする 2 項目の配列を返します。
console.log(iterableStyles.next().value);

仕様書

No specification found

No specification data found for api.StylePropertyMapReadOnly.entries.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
entries

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.