So I am currently making a loading screen with only JavaScript. And I am trying to add display: none;
into all elements before the load screen.
I have tried this method:
var elements = document.querySelectorAll( 'body > *' );
elements.style.display="none";
but it just came out as
Uncaught TypeError: Cannot set property 'display' of undefined
at <anonymous>:2:23
How do I do it?