On DOM Ready
Examples in
JavaScript
document.addEventListener('DOMContentLoaded', function(event) {
console.log('ready');
});
document.addEventListener('DOMContentLoaded', function(event) {
console.log('ready');
});