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

How to search text in string using php ?

29-10-2017 php search string search

How to convert html to pdf in Node js

12-03-2017 pdf convert html node js

Change datepicker display format

06-03-2017 datepicker angular js

Email validation regular expression in javascript

22-02-2017 email validation regex