+ 3
Styling in JS
I get the error null is not an object and I canât find any post with this issue. What is it? https://code.sololearn.com/Wq9DGR4zc083/?ref=app
2 Answers
+ 5
Korijn,
You declared the variable outside and underneath the function.
The variable wont be recognized since it is declared after the function.
Declare the variable inside the function to fix your issue.
If you declare it to be global it is nessecary to initialize the DOM first since SL uses the script between the head tags instead of the bottom of the body
Have a look at the changesđ
https://code.sololearn.com/WX60qm7IFBbn/?ref=app
+ 1
Thanks, I understand now