I have the following HTML :
<ul id="nav">
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
<li><a href="#">Four</a></li>
</ul>
On attempting to walk the element,
1 nav.childNodes.length
is 9, What are the nine nodes?
2 nav.childNodes[0].nodeType
is 3, but .nodeValue
is empty.
EDIT:
It works fine after doing:
<ul id="nav"><li><a href="#">One</a></li><li><a href="#">Two</a></li><li><a href="#">Three</a></li><li><a href="#">Four</a></li></ul>
Why is white-space being counted as nodes?