nodeValue (W3C DOM Core property)
var value = node.nodeValue;
So in the following HTML example, the
id attribute has the node value
tagline, the text node inside the
element has the node value
A Tale of Two Springfields,
q element itself has a
null node value:
<q id="tagline">A Tale of Two Springfields</q>
A common mistake is to think that the text inside an element is that element's node value, but that isn't the case. As we've seen, the element itself has no node value — it has a child text node, and that has a node value equal to its content.
property is read/write — it can be used to set the value as well as get
This property is read/write.
Opera 9.0 in pure XML (but
not XHTML mode2) parses entities when setting the
of an attribute (contrary to the specification).
In Internet Explorer 5.5 in HTML it's
only possible to refer to an attribute's value, not to the
node itself, however attribute values retrieved through the
attributes collection do inherit the
properties. For nodes that are available, this property always returns
There are no comments yet.