What's the difference between childNodes and children properties?
The difference is that childNodes includes all node types (Element nodes, Text nodes, Comment nodes, etc.), while children includes only Element nodes. This distinction is important when working with HTML where whitespace often creates text nodes between elements. If you're only interested in the element structure and want to ignore whitespace text nodes, use the children property. If you need to access all nodes including text and comments, use childNodes.