The clearInterval()
method of the WindowOrWorkerGlobalScope
mixin cancels a timed, repeating action which was previously established by a call to setInterval()
.
scope.clearInterval(intervalID)
intervalID
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.
See the setInterval()
example.
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 |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 1 | Yes | 1
|
4 | 4 | 4 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 1 | 18 | Yes | 4
|
6 | 1 | ? |
WindowOrWorkerGlobalScope.setTimeout
WindowOrWorkerGlobalScope.setInterval
WindowOrWorkerGlobalScope.clearTimeout
Window.requestAnimationFrame
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval