I can't find error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I can't find error

Where is the error in my code? https://code.sololearn.com/W7SvctXuO73J

22nd Aug 2018, 7:15 PM
Chocolatte
Chocolatte - avatar
1 Answer
+ 1
1) window.onload accept a function like value not a string.. window.onload= test; Note that its not a call to test but a reference to test function 2) Make note that for get reference to element (like in getElementById) you have to make sure that browser has yet loaded it and in this case its not true... You have to get 'box' reference then window is loaded
22nd Aug 2018, 8:46 PM
KrOW
KrOW - avatar