Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT
  Features
      Ask DevGuru
      ASP Resources
      HTML Color Chart
      Find the Bug
      Knowledge Base
      Links
      Tips of the Week
      T-SQL Syntax Charts
      Tutorials
  Products
      dgCalendar
      dgCharge
      dgChart
      dgEncrypt
      dgFileUpload
      dgReport
      dgSort
      dgTree
  Site
      Authoring
      Coming Soon
      DevGuru Resume
      Errata
      Link to Us
      Merchandise
      Sponsorships
      Testimonials
      What's New
  Partners
      Code Project
      DevelopersDex
      Prog. Heaven
      Tek-Tips Forum
      TopXML
      VBXML.COM
      VisualBuilder.com
      W3Schools
      XMLPitstop
      ZVON.org
      Search Us!

       











PROPERTY:  Object::nodeType

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

The nodeType property is read-only and specifies the type of the node. For details of the different node types see the Node object.

The following example uses the 'states.xml' file and obtains the node types of the document itself, and of the document's root node.

XML:
<States>
   <State ref="FL">
      <name>Florida</name>
      <capital>Tallahassee</capital>
   </State>
   <State ref="IA">
      <name>Iowa</name>
      <capital>Des Moines</capital>
   </State>
</States>

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

var n = xml_doc;
document.write(n.nodeType);
n = xml_doc.documentElement;
document.write("<br>" + n.nodeType);

Output:
9
1

The node type enumerations 9 and 1 represent document and element nodes respectively (see the Node object).





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