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:

File Upload Using Angular Js and Node Js

28-05-2018 AngularJs Node js file upload multer module

Using slice remove last two characters from given string

07-03-2017 slice remove

Filter for change Date format (MM-dd-yyyy) in Angular Js

05-03-2017 mm-dd-yyyy date formats angular js

How to get drop down value when drop down change using javascript

27-02-2017 onchange events dropdown javascript functions

How to remove last / value from url in javascript

27-02-2017 array javascript last value