Call a function every second or 5 seconds in javascript

setinterval
function calling

call a javascript function every 5 seconds continously.  You can use setInterval(). The below code is working from onload.

setInterval(test,5000);
function test()
{
	alert("hi");
}

 

 

You might also like:

How to convert html to pdf in Node js

12-03-2017 pdf convert html node js

Get previous date from given date in javascript

06-03-2017 date javascript previous date

Navigate to another page using java script

06-03-2017 javascript redirection navigation

Filter for replace text in Angular Js

05-03-2017 filter replace angular js

Call a function every second or 5 seconds in javascript

22-02-2017 setinterval function calling