7th Jul 2020, 2:45 AM
Abhishek Singh
Abhishek Singh - avatar
3 Respostas
+ 5
https://code.sololearn.com/WamWDjbVaSno/?ref=app
7th Jul 2020, 2:54 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Abhishek Singh As your JS code is running even before the document has loaded, it throws an error that there is no such element. As suggested by Aymane Boukrouh , you need to wrap the entire js code inside a function which runs only after the Window is loaded.
7th Jul 2020, 3:11 AM
Hanuma Ukkadapu
Hanuma Ukkadapu - avatar
+ 2
Aymane Boukrouh Thank you for the code Hanuma Ukkadapu Thank you for explanation
7th Jul 2020, 3:13 AM
Abhishek Singh
Abhishek Singh - avatar