jQuery's $.ready()
function is used to execute a function when the DOM is fully loaded. The equivalent in vanilla JavaScript is to use the DOMContentLoaded
event.
document.addEventListener('DOMContentLoaded', function(){
// your code goes here
}, false);