wait until document loaded javascript code example
Example: javascript wait for document load
document.addEventListener("DOMContentLoaded", function(event) {
//do work
});
document.addEventListener("DOMContentLoaded", function(event) {
//do work
});