Can someone explain why this won't work?
var element = document.getElementById('element'); // Works OK
var slide = element.getElementById('slide'); // Throws an error
So the idea is to fetch DOM only once, and I have all the tags in that one variable, and then I can manipulate it and get the rest from that variable.
How can I get other elements from element
variable?
Is it a bad thing to use document.getElementById('id');
every time I need something from the DOM? Does it slows down webpage?
And how would I solve this problem?
No jQuery please, pure Javascript!
Thanks