+ 4

Fix that error

I want to change the html containt by js code https://code.sololearn.com/W295pLx6Yszm/?ref=app

6th Mar 2019, 10:29 AM
Adnan Ansari
Adnan Ansari - avatar
3 Respuestas
+ 4
Do : window.onload = function() { //your code here } That will wait the entire page is loaded before executing your JS code.
6th Mar 2019, 10:36 AM
Théophile
Théophile - avatar
+ 4
//As Théophile said change your js code to this var adnan = document.getElementById("ad").innerHTML = "<P>ADNAN IS GREAT</P>";
6th Mar 2019, 10:42 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 3
Thanks its work for me
6th Mar 2019, 11:17 AM
Adnan Ansari
Adnan Ansari - avatar