+ 1

Help me to find the bug...

Code is working fine in local browser but it's not working in Solo Learn https://code.sololearn.com/WZu3GN9jyoRY/?ref=app

1st Jan 2019, 4:11 PM
Gana
Gana - avatar
1 Answer
+ 1
This is because the Javascript loads first in the JS Tab, meaning the HTML hasnt loaded yet, and can't get any elements from it. This can be fixed by putting the variables inside a window.onload function.
2nd Jan 2019, 6:18 AM
Lemuel
Lemuel - avatar