Jquery Setinterval Example - Jquery

How to call a function at specified intervals in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

Setinterval method is used to set some regular interval of time to execute a function. Here setinterval() function evaluates an expression at specified intervals.Here the function oncall() is used to call every function at an interval of 3 seconds on clicking button.

<script> function intervalfun() { setInterval(function(){ oncall() }, 3000); } function oncall() { alert("This function is called for every 3 seconds!!"); } </script> <input type='button' value='Click' onclick='intervalfun()'>

Tags


Ask Questions

Ask Question