+ 1
Please what can be the problems my code it keeps giving me can't set property of 'className' null
https://code.sololearn.com/WB98QIcB1x3A/?ref=app Henry Chigozie wave rider Michael Ngwerume Yeva
3 Answers
+ 2
Do not use foul language as webpage title!
Reason: You try to access the DOM before it exists.
window.onload is the listener to ensure the scripts are executed after DOM exists.
A short cure for your current version :
window.onload = function() {
test();
}
Demo for full understanding :
https://code.sololearn.com/WriFNOoR188j/?ref=app
+ 1
Also, replace div "holder" with div id="holder".