Internet Explorer will skip the white-space text node that
are generated between nodes (e.g. new line characters), while
Mozilla will not. So, in the example above, Mozilla browser
will alert 9 child nodes, while Internet Explorer will alert 4.
To iterate through the child node and disregard those text
nodes, you can check the node type. An element node has the type 1,
a text node has the type 3, and a comment node has the type 8. To skip
text node, you can process only nodes that are not of node type
3 (text nodes) and node type 8 (comment nodes):
|