javascript - simple jquery second counter -
What is the easiest way to increase a variable in 1 second?
var counter = 0; Set interval (function () {++ counter;}, 1000);
Additionally, if you need to turn it off again, it makes this possible:
var counter = 0; Var myInterval = setInterval (function () {++ counter;}, 1000); // counter to stop interrupt (myInterval);
Comments
Post a Comment