There is a method to select all the tags on the page inside the body?
Analogue document.body.innerText , but for tags.

Or you need to consistently go through all the body children and check them for the presence of your children? Thank!

  • one
    Need to select all the items in the house? Or certain tags? If the first, then nothing else like a recursive tree traversal, I do not see. In this case, what is the sample structure should get? Multidimensional array object? - pepel_xD
  • All elements in the DOM. Structure is not important. - Lex

1 answer 1

GetElementsByTagName () should come up

var all = document.body.getElementsByTagName("*");