Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14655 reviews 1734 hosting providers

Questions & Answers

how to stop the timing event in javascript?

Aug 11, 2012 by sally23

I want to use the timing event setInterval() to execute a specific function at specified time intervals but I am not sure how to stop the execution of my method once it starts?


2 Answers

0 votes
Aug 11, 2012 by SmartHost
Use the clearTimeout() method after your setinterval() method
0 votes
Aug 11, 2012 by WebProX
Use this :
clearInterval(intervalVariable)  where intervalvariable in the same variable you used inside your setInterval() method