Retrieves a collection of all objects to which a specified>behavior is attached.
Remarks
The childNodes collection can contain HTML Elements and TextNode objects.
If you check the childNodes collection of an element created through standard HTML you will encounter TextNode objects in unexpected places, in place of line breaks, for example. Alternately, if you create an element via the Document Object Model (DOM), Internet Explorer will not create extraneous TextNode objects.
Examples
This example shows how to assign to a variable the childNodes collection of the body object.
This example shows how to assign to a variable the childNodes collection of a node created with the createElement method.
var oParentNode = document.createElement("DIV");
var oNode = document.createElement("B");
document.body.insertBefore(oParentNode);
oParentNode.insertBefore(oNode);
var aNodeList = oParentNode.childNodes;
Standards Information
collection is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .