PROPERTY:  Object::firstChild

Object  Attr   CDATASection   CharacterData   Comment   DocumentFragment   DocumentType   Entity   EntityReference   Node   Notation   ProcessingInstruction   Text

The firstChild property is read-only and returns the first child of a given node. If there is no first child, or the node is of a type that cannot have child nodes (see the DOM Structure Model), then it returns null.

The example that follows obtains the text of the first child node of the root element of the 'states.xml' file.

   <State ref="FL">
   <State ref="IA">
      <capital>Des Moines</capital>

Code (JavaScript):
var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;

var f_child = xml_doc.documentElement.firstChild.text;

Florida Tallahassee

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information