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

The **`clear()`** method of the {{domxref("CustomStateSet")}} interface removes all elements from the `CustomStateSet` object.

## Syntax

```js
CustomStateSet.clear()
```

### Parameters

None.

### Return Value

Undefined.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

