I've read the following very good article: Difference between Node object and Element object? as to clear out the difference between a node object and an element object. I 've understood that
element objects are a subset of node objects.
So, after that I've come upon the following query: In which way may I iterate through all the node objects? By using document.getElementsByTagName('*')
,I think I am getting all the element objects since all of them have value 1 for their .nodeType
property. Am I right and if yes, how may I include into my results all these nodes that are not elements?
Thank you