+ 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

20th Dec 2018, 5:47 AM
Reward
Reward - avatar
3 Antworten
+ 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
20th Dec 2018, 6:19 AM
Gordon
Gordon - avatar
+ 1
Also, replace div "holder" with div id="holder".
20th Dec 2018, 6:28 AM
Anna
Anna - avatar
20th Dec 2018, 5:48 AM
Reward
Reward - avatar