document.addEventListener("DOMContentLoaded", onReady); function onReady(){ console.log("ready yo") }