+ 1
Why doesnt document.body work?
So upon playing around i noticed that although document.body is null, if i instead use documentElement my code works....why? https://code.sololearn.com/WgGffE44Pach/?ref=app
2 Antworten
+ 7
You just did a simple mistake:
Wrong :
window.onload = start();
Correct :
window.onload = start;
If you do this, both document.documentElement and document.body will work :))
+ 2
😶