Breaking News
Loading...

Jquery Call a Function for Every 5 Seconds

Share on Google Plus

Timing Events

The window object allows execution of code at specified time intervals.
These time intervals are called timing events.
The two key methods to use with JavaScript are:
  • setTimeout(function, milliseconds)
    Executes a function, after waiting a specified number of milliseconds.
  • setInterval(function, milliseconds)
    Same as setTimeout(), but repeats the execution of the function continuously.
window.setInterval(function(){
  /// call your function here
}, 5000);
To Change the Number of seconds
for 5 Seconds - 5000
for 10 Seconds - 10000



See the Pen WQMJqx by Arun Yokesh (@yokesh) on CodePen.

You Might Also Like

0 comments

About me


Like us on Facebook