+ 13
Countdown timer
how to create a simplest countdown timer which counts from user inputted number to 0..I need a simplest method...
3 Answers
+ 11
setTimeout(callback,timemilliseconds);
0
var time = 60; //this can be whatever you want
setTimeout(function() {
time--;
}, 1000); // decrement after 1 second
if (time <= 0) {
done();
}
function done() {
//put the code that you want to handle the done call in here
}