Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
window.setInterval() Method in Window Object of Javascript Syntax with Examples
2439 Views
Usage 
The setInterval() method is used to display message or call function at specified interval of time.
Syntax 
setInterval(message or function,interval);
Syntax
function doIt(){
  document.body.innerHTML = "";
  document.write(new Date()+"<br />");
}

setInterval(doIt,1000);
Output 
It will display current time at every second.

"Sat Dec 06 2014 11:49:00 GMT+0530 (India Standard Time)"
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details