document.ready in vanila js code example
Example 1: document ready
$( document ).ready(function() {
console.log( "ready!" );
});
Example 2: document ready vanilla js
if (document.readyState === "complete") { init(); }
$( document ).ready(function() {
console.log( "ready!" );
});
if (document.readyState === "complete") { init(); }