Javascript Reference
Categories: Node

javascript Node childNodes[ ]

@March 15, 2008, 1:22 a.m.
childNodes[ ]Firefox/Netscape/NN 6 IE 5 Chrome/Safari/DOM 1  

Read-only  

This is a property of the W3C DOM Node object that consists of an array of references to all child nodes (a node list) in the next deeper level of the node hierarchy (whether part of the document node tree or free-standing document fragments not yet inserted into the document tree). To reach more deeply nested nodes, you must access the childNodes array of each child node of the current node. A vital property for walking through a node tree. See the NodeList object for the properties and methods of this kind of array.

 
Example
 
for (var i = 0; i < nodeRef.childNodes.length; i++) {
		    if (nodeRef.childNodes[i].nodeType == document.ELEMENT_NODE) {
		        // operate on an element
		    }
		}
 
Value

Array of node object references.

 
Default

Array of length zero.

I hardly understand programing thing. I didn't understand anything though I would love to.
Roulette Rock-star - 3 years

Powered by Linode.