how to load document.getready function first code example Example: dom ready js document.addEventListener("DOMContentLoaded", function() { // code });