WindowOrWorkerGlobalScope.clearInterval() - Web APIs 编辑
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
Example
See the setInterval()
examples.
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
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论