Window: clearInterval() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
clearInterval()
は Window
インターフェイスのメソッドで、以前に setInterval()
の呼び出しによって確立された時限繰り返し動作を取り消します。指定された引数で前回確立されたアクションを識別できなかった場合、このメソッドは何も行いません。
構文
clearInterval(intervalID)
引数
intervalID
-
取り消したい繰り返し動作の識別子です。この ID は対応する
setInterval()
の呼び出しの返値です。
setInterval()
と setTimeout()
で使用する ID のプールが共有されていることは注目に値します。つまり、技術的には clearInterval()
と clearTimeout()
は交換することができます。
しかし、わかりやすくするために、そうすることは避けるべきです。
返値
なし (undefined
)。
例
例については setInterval()
を参照してください。
仕様書
Specification |
---|
HTML # dom-clearinterval-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clearInterval | ||||||||||||||
Available in workers |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support