+ 1

why this code is not working

hey guys i make a program in javascript , but this code is not working , anyone can help me ----https://code.sololearn.com/Wl0GkkaXau58/#html

6th Sep 2019, 7:20 AM
SACHIN.SHERA
SACHIN.SHERA - avatar
5 Answers
+ 4
Explanation: The JavaScript codes runs first before the DOM(HTML tags)loaded Write your code inside the onload() function Like this window.onload=function(){ //JavaScript code } This will make sure that the DOM loaded first
6th Sep 2019, 8:16 AM
Farhan
Farhan - avatar
+ 3
Write the js like this: window.onload=function(){ //your js }
6th Sep 2019, 7:28 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
6th Sep 2019, 8:18 AM
SACHIN.SHERA
SACHIN.SHERA - avatar
0
Put your script source in the <head> tag
6th Sep 2019, 10:47 AM
Anthony Johnson
Anthony Johnson - avatar