event listener for when element loaded code example
Example: document.addEventListener("load", function () {
window.addEventListener('load', (event) => {
console.log('page is fully loaded');
});
window.onload = (event) => {
console.log('page is fully loaded');
};