There are events in JavaScript we can use to capture the DOM elements (as variables). But sometimes, we can't precisely detect when they will be complete (ready for DOM manipulation) using "only" the event ( load , DOMContentLoaded , readystatechange , etc). Especially if they are injected dynamically. Let's Structure of using setInterval The JavaScript basic coding looks like this: (function (d) { var interval; // for [setInterval] method; // the function to check the element function check() { var element_we_want_to_detect; if ( element_we_want_to_detect ) { // console.log("element is found"); // attach a callback or directly do something here clearInterval( interval ); // stop the timer } else { // still checking // do something else or just be quiet } } // repetitively call the [check] function above interval = setInterval( check, [duration] ); }(document)); Using s...