js wait document ready

50

js wait document ready -

document.addEventListener("DOMContentLoaded", function(event) { 
  //do work
});

wait for the dom to load javascript -

document.addEventListener('DOMContentLoaded', (event) => {
  //the event occurred
})

Comments

Submit
0 Comments