+ 2
How to set count down timer in JavaScript
I want to set a timer for 30 minutes and it should count down and come to 0 using java script I used setInterval() and setTimeout() but it is not working
5 Answers
+ 2
function myTimeoutFunction() {
doStuff();
setTimeout(myTimeoutFunction, 1000); } myTimeoutFunction();
+ 1
setInterval(function(){
doStuff()
}, 1000);
+ 1
you can check my first code here(Session Timer),it's all about intervals using only native js,maybe it will help you to undestand how things work...
It was my first js experiments :D
- 1
show your code with setInterval
- 2
function doStuff() {
alert("go to next");
}