Good morning sir. When i access p in script ans set it and run html file without Window.onload function. What happens?I get eror
1 Answer
New Answerrun script without window.onload https://code.sololearn.com/W70ybgu3J1Np/?ref=app
5/2/2022 7:59:10 AM
Malick Diagne1 Answer
New AnswerMalick Diagne if you don't use window.onload, you will get error because your javascript code is executing before the loading of your html file. Because of this there was no <p> tag was created. So your variable paragraph was NULL, that's why it shows error because document.getElementById( ) did not found any <p> tag in the html document
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message