how to stop the timing event in javascript?

61 views
asked Aug 11, 2012 in General by sally23 (1,250 points)
Hi..

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?

thanks

2 Answers

0 like 0 dislike
answered Aug 11, 2012 by SmartHost (9,060 points)
Use the clearTimeout() method after your setinterval() method
0 like 0 dislike
answered Aug 11, 2012 by WebProX (12,200 points)
Use this :
clearInterval(intervalVariable)  where intervalvariable in the same variable you used inside your setInterval() method
...