Answers for "wait for DOM to load before using getElementById"

1

jquery wait for element to exist

var checkExist = setInterval(function() {
   if ($('#the-canvas').length) {
      console.log("Exists!");
      clearInterval(checkExist);
   }
}, 100); // check every 100ms
Posted by: Guest on January-11-2021

Code answers related to "wait for DOM to load before using getElementById"

Code answers related to "Javascript"

Browse Popular Code Answers by Language