javascript wait elements chargiong in dom code example Example: dom ready js document.addEventListener("DOMContentLoaded", function() { // code });