Reputation: 103
When i use childnode it also return, text and column and then it starts the element. Can some explain why it does that?
Upvotes: 0
Views: 634
Reputation: 1835
Per the MDN docs (emphasis mine):
It is important to keep in mind that
childNodes
includes all child nodes, including non-element nodes like text and comment. To get a collection containing only elements, useElement.children
instead.
Upvotes: 1