The nodeValue Property


The nodeValue Property

The nodeValue property returns a node's valuebut note that this has meaning only for text nodes (where the node's value is the text itself) and attribute nodes (where the node's value is the value assigned to the attribute). For other nodes, such as element nodes, this property is null (which evaluates to false in Boolean conditions such as those you use in if statements). You can see the support for this property in Table 5.39.

Table 5.39. The nodeValue Property

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

nodeValue

     

x

     

x

x

x

 

Read/Write

 

Type: String, number, or null

Tip

Technically, this property should always return a string, and it is a string in the Netscape Navigator; however, the Windows version of Internet Explorer (not the Mac version) returns a number if the attribute value is a number.


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