SetInterval

Shows how to use JavaScript SetInterval method. Div with id="count" shows the number of seconds from start of the application.
var secondsCounter = 0;
var timerDiv = document.getElementById("count");

setInterval(function(){
	secondsCounter++;
	timerDiv.innerHTML = secondsCounter;
}, 1000);

Responses

0 Replies