0

help something is wrong with my code

https://code.sololearn.com/W3adxN6960HW/?ref=app I copied from git hub cleaned it up not sure what is wrong I guess css

20th Jul 2019, 4:06 PM
Leonardo Monterey
Leonardo Monterey - avatar
5 Réponses
+ 2
The javascript runs before the document loaded, therefore getElementById doesn't work. You should either use the window.onload function or place the whole script inside the body.
20th Jul 2019, 4:08 PM
Airree
Airree - avatar
+ 1
In sololearn, html, css and js are included by default, you don't have to worry about that. I already answered your question
20th Jul 2019, 4:22 PM
Airree
Airree - avatar
0
thanks but I have been having that problem Not sure excatly how to link the javascript . I think in the body like in the solo learn lesson <script src="what do I write here?/ demo.js" i dont know
20th Jul 2019, 4:21 PM
Leonardo Monterey
Leonardo Monterey - avatar
0
alright, idk what that(wind.onload) is but I will look it up thanks
20th Jul 2019, 4:27 PM
Leonardo Monterey
Leonardo Monterey - avatar
0
got it fixed, turns out it was just syntax error, I did add windo.onload and setupevents. seems that my real lesson here is about debugging, asking for help, and teamwork :p we did it!!!!!!!! thanks also just for laughs, it dosent work when I comment out set up events and window.onload
21st Jul 2019, 12:42 AM
Leonardo Monterey
Leonardo Monterey - avatar