Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. StylePropertyMapReadOnly
  4. keys()

StylePropertyMapReadOnly: keys() method

Limited availability

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

TheStylePropertyMapReadOnly.keys() method returns a newarray iterator containing the keys for each iteminStylePropertyMapReadOnly

Syntax

js
keys()

Parameters

None.

Return value

A newArray.

Examples

In this example we use thekeys() method to be able to access theproperties within ourElement.computedStyleMap().

js
// get a button elementconst buttonEl = document.querySelector("button");// we can retrieve all computed styles with `computedStyleMap`const allComputedStyles = buttonEl.computedStyleMap();// keys returns an iterable list of propertiesconst props = allComputedStyles.keys();console.log(props.next().value); // returns align-content

Specifications

This feature does not appear to be defined in any specification.

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp