Window.clearInterval() (Method)

Cancel a previous setInterval() timer that caused a function to be called periodically.


JavaScript - 1.2
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:undefined
JavaScript syntax:-clearInterval(anIntervalID)
Argument list:anIntervalIDThe ID of an interval returned by the setInterval() method

The interval timer mechanism can be used to repeat the execution of a block of script code at regular intervals. You can establish several blocks of repeating code at once if necessary, so there could be a number of pending interval timers. You must be able to identify the one that you want to clear.

When you create an interval timer with the setInterval() method, it will return back to you with a value that corresponds uniquely to that interval's set-up context. You can use that value later to clear the interval timer.

You must be careful not to clear an interval more than once.


See also:Frame object, Interval handlers, Timeout handlers, Timer events, Window object, Window.clearTimeout(), Window.setInterval(), Window.setTimeout()