The clearInterval() method of the WindowOrWorkerGlobalScope mixin cancels a timed, repeating action which was previously established by a call to setInterval().

Syntax

scope.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() and setTimeout() are shared, which means you can technically use clearInterval() and clearTimeout() interchangeably. However, for clarity, you should avoid doing so.

Return value

undefined

Example

See the setInterval() example.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'WindowOrWorkerGlobalScope.clearInterval()' in that specification.
Living Standard Method moved to the WindowOrWorkerGlobalScope mixin in the latest spec.
HTML Living Standard
The definition of 'clearInterval()' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 1Edge Full support YesFirefox Full support 1
Full support 1
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
IE Full support 4Opera Full support 4Safari Full support 4WebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4
Full support 4
Full support 52
Notes
Notes clearInterval() now defined on WindowOrWorkerGlobalScope mixin.
Opera Android Full support 6Safari iOS Full support 1Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

See also