How to stop javascript timer

醉折花枝作酒筹
Release: 2021-06-15 14:40:08
Original
12472 people have browsed it

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.

How to stop javascript timer

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

   无标题文档  
Copy after login

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)
Copy after login

[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!