aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/stylepropertymapreadonly/keys/index.md
blob: d771251f8d01d640e088887f08aa1d7c9584cd84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: StylePropertyMapReadOnly.keys()
slug: Web/API/StylePropertyMapReadOnly/keys
tags:
  - API
  - CSS Typed Object Model API
  - 実験的
  - Houdini
  - メソッド
  - リファレンス
  - StylePropertyMapReadOnly
  - keys()
browser-compat: api.StylePropertyMapReadOnly.keys
translation_of: Web/API/StylePropertyMapReadOnly/keys
---
{{APIRef("CSS Typed Object Model API")}}{{SeeCompatTable}}

**`StylePropertyMapReadOnly.keys()`** メソッドは、 `StylePropertyMapReadOnly` の各項目のキーを含む新しい*配列反復子*を返します。

## 構文

```js
StylePropertyMapReadOnly.keys()
```

### 引数

なし。

### 返値

新しい {{jsxref("Array")}} です。

## 例

この例では、 `keys()` メソッドを使用して {{domxref('Element.computedStyleMap()')}} の中にあるプロパティにアクセスすることができます。

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

// すべての計算済みスタイルを `computedStyleMap` で受け取る
const allComputedStyles = buttonEl.computedStyleMap();

// keys はプロパティの反復可能なリストを返す
const props = allComputedStyles.keys();
console.log(props.next().value); // align-content を返す
```

## 仕様書

{{Specifications}}

## ブラウザーの互換性

{{Compat}}