yanivk1984
8/29/2019 - 4:13 PM

javascript check if element appears in interval

let checkExist = setInterval(function() {
       if ($('#the-canvas').length) {
          console.log("Exists!");
          clearInterval(checkExist); // if it appeared, stop the loop
       }
    }, 100); // check every 100ms