Pure JavaScript equivalent of jQuery’s $.ready()
Supported by all modern browser and IE9+. var callback = function() { // Handler when the DOM is fully loaded }; if (document.readyState === “complete” || (document.readyState !== “loading” && !document.documentElement.doScroll) ) { callback(); }…