data (W3C DOM Core property)

Spec
Version Depr. Static Read-only
DOM1 No No No
Browser support (more…)
IE5.5+ FF1.5+ SA1.3+ OP9+
Full Full Full Full

Example

var nodedata = node.data;

The example above stores the data of a node to the nodedata variable. So if node were a Text node, such as the text inside the quote in the following example:

<q>Reverse the polarity of the neutron flow</q>

Then the nodedata variable would have the value Reverse the polarity of the neutron flow. This is also the same as its nodeValue.

Description

The character data of a Text, Comment or CDATASection node, or the data in a ProcessingInstruction node.

This property is read/write.

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.5 2.0 3.0 1.3 2.0 3.0 9.0 9.5
Full Full Full Full Full Full Full Full Full Full Full
: Works when available!

There are wide variations in when the objects that this property belongs to are available (see each interface separately for details); however when available, this property always returns correctly, hence it's considered to be fully supported with no known issues.

User-contributed notes

There are no comments yet.

Related Products