Why the value of arr.length is 5?

From docs:

childNodes includes all child nodes, including non-element nodes like text and comment nodes. To get a collection of only elements, use ParentNode.children instead.

1 Like