# Window: clearInterval() method



The **`clearInterval()`** method of the [Window](https://developer.mozilla.org/en-US/docs/Web/API/Window) interface cancels a timed, repeating action which was previously established by a call to [setInterval()](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval). If the parameter provided does not identify a previously established action, this method does nothing.

## Syntax

```js-nolint
clearInterval(intervalID)
```

### Parameters

- `intervalID`
  - : The identifier of the repeated action you want to cancel. This ID was returned by
    the corresponding call to `setInterval()`.

It's worth noting that the pool of IDs used by
[setInterval()](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval) and
[setTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout) are shared, which
means you can technically use `clearInterval()` and
[clearTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearTimeout) interchangeably.
However, for clarity, you should avoid doing so.

### Return value

None ([undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)).

## Examples

See [setInterval()](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval) for examples.

## Specifications

## Browser compatibility

## See also

- [Window.setInterval()](https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval)
- [WorkerGlobalScope.clearInterval()](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/clearInterval)
- [Window.clearTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/Window/clearTimeout)
- [Window.cancelAnimationFrame()](https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame)
