document fully loaded on javascript code example
Example 1: content of page fully loaded javascript
document.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM completely loaded and analyzed');
});
Example 2: dom is loaded
document.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});