I\'m trying to get all the elements (tags) inside the Body tag of an HTML page in an array using pure javascript. I mean without using any framework (ex. JQuery).
I
You can use document.querySelectorAll() for that.
If you really want all (including nested tags), use this
var elements = document.querySelectorAll( 'body *' );
If you only want the immediate child nodes, use
var elements = document.querySelectorAll( 'body > *' );