---
title: CustomStateSet.keys()
slug: Web/API/CustomStateSet/keys
tags:
  - API
  - Method
  - Reference
  - keys
  - CustomStateSet
browser-compat: api.CustomStateSet.keys
---
{{DefaultAPISidebar("DOM")}}

The **`keys()`** method of the {{domxref("CustomStateSet")}} interface is an alias for {{domxref("CustomStateSet.values")}}.

## Syntax

```js
CustomStateSet.keys()
```

### Return Value

A new iterator object containing the values for each element in the given `CustomStateSet`, in insertion order.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

