lundi 4 janvier 2021

How can I call JavaScript function after the whole web page loaded?

I have JavaScript function , I want to run this function when naukri site's webpage is completely loaded, But it's not working. here is my code

window.onload = function() {
var btn = document.getElementsByClassName('title');
for (var i = 0; i < btn.length; i++) {
    btn[i].insertAdjacentHTML('afterend', `
          <div> <button class= "btn">
                <img src="logo.png" height="20px" width="70px">
             </button>
          </div>
        `);
    }
}



Aucun commentaire:

Enregistrer un commentaire