0

How'd do you call elements in JavaScript here in sololearn??Everytime I use query selector it returns null

https://code.sololearn.com/WS5H7mH0aDWc/?ref=app

16th Jul 2023, 12:46 PM
Indiphile Menziwa
Indiphile Menziwa - avatar
2 Answers
+ 7
You can only get the element once the DOM is fully loaded. Put all your js in window.onload = () => { // your js }
16th Jul 2023, 12:49 PM
Lisa
Lisa - avatar
+ 2
Wow that was easy, Thank you 😁
16th Jul 2023, 2:01 PM
Indiphile Menziwa
Indiphile Menziwa - avatar