0

Why JS doesn't work here?

But it works fine in codepen for example.. https://code.sololearn.com/WLvPy3EQkDVK/#js

25th Apr 2018, 9:34 PM
Alexandr Covalschi
Alexandr Covalschi - avatar
2 Answers
+ 1
when you write web codes on sololearn your js should be kickstarted with window.onload
25th Apr 2018, 9:37 PM
Hannah
Hannah - avatar
+ 4
The reason why is that sololearn puts your javascript codes in the head element but codepen puts it in the end of your document.
25th Apr 2018, 9:48 PM
Toni Isotalo
Toni Isotalo - avatar