If you want all elements inside the body tag, not just first level children, you can simply use getElementsByTagName() with a wildcard:
var elems = document.body.getElementsByTagName("*");
If you want all elements inside the body tag, not just first level children, you can simply use getElementsByTagName() with a wildcard:
var elems = document.body.getElementsByTagName("*");