The nodeType Property


The nodeType Property

The nodeType property returns a numeric value indicating the type of a node. You can see the support for this property in Table 5.37.

Table 5.37. The nodeType Property

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

nodeType

     

x

     

x

x

x

 

Read/Write

 

Type: Integer

You can see the possible node type values in Table 5.38; here, I'm including all possible values for both XML and HTML documents, because you can mix HTML and XML documents in the Internet Explorer (more on this in Chapter 22, "XML and XSLT"). The only valid node types for HTML nodes are 1, 2, 3, 8, 9, 10, and 11.

Table 5.38. W3C Node Types

Number

Means

1

Element

2

Attribute

3

Text node

4

CDATA (character data) section

5

Entity reference

6

Entity node

7

Processing instruction

8

Comment

9

Document node

10

Document Type Definition (DTD)

11

Document fragment

12

Notation

For an example using this property, see the nodeName topic earlier in this chapter.



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net