In JavaScript, you can use the clearInterval method to stop the timer. The syntax is "clearInterval (timeout set by the setInterval method)". The parameter of this method must be the ID value returned by setInterval.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
无标题文档
clearInterval() method can cancel the timeout set by setInterval().
The parameter of the clearInterval() method must be the ID value returned by setInterval().
Grammar
clearInterval(id_of_setinterval)
[Recommended learning:javascript advanced tutorial]
The above is the detailed content of How to stop javascript timer. For more information, please follow other related articles on the PHP Chinese website!