1. Home
  2. Javascript
  3. Set interval

Allows to run a function in regular intervals. The second argument takes the interval time in milliseconds. The example checks for the existence of the class before stopping the loop.

var checker = setInterval(function() {
    if (document.querySelector('.sc')) {
       console.log('Fount it!');
 }, 100);
Full Javascript cheatsheet
Sitemap Git repository