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 submit form using javascript or jquery.

16-04-2017 javascript jquery submit form

How to set or update or push the values into Object in javacript

27-02-2017 javascript set update push object

How to remove last / value from url in javascript

27-02-2017 array javascript last value

Call a function every second or 5 seconds in javascript

22-02-2017 setinterval function calling

Send Mail in Node Js

21-02-2017 node js mail npm module