Home / Tips / Programming languages / Scripting languages / JavaScript / How to stop setInterval call in JavaScript

How to stop setInterval call in JavaScript

JavaScript
 
JavaScript
  • Currently 0 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0/5 (0 votes cast)

Thank you for rating!

You have already rated this page, you can only rate it once!

Your rating has been changed, thanks for rating!

Log in or create a user account to rate this page.


The clearInterval method has to be used to stop the setInterval call.

The setInterval method returns ID which can be used as the parameter for the clearInterval method.

var intervalID = setInterval( myFunction, 5000 );
clearInterval( intervalID );

 

Read also

Post comment

basicuse.net
html5_css
106160485398655174790

Quick navigation

General navigation