XML DOM nodeValue property
Definition and Usage
nodeValue property sets or returns the value of a node, depending on its type.
grammar
documentObject.nodeValue
In all instances, we use XML files books.xml and the JavaScript function loadXMLDoc () .
Examples
The following code fragment displays the node name and the node value of the root node:
Examples
xmlDoc=loadXMLDoc("books.xml");
document.write("Nodename: " + xmlDoc.nodeName);
document.write(" (value: " + xmlDoc.childNodes[0].nodeValue);
document.write("Nodename: " + xmlDoc.nodeName);
document.write(" (value: " + xmlDoc.childNodes[0].nodeValue);
Output:
Nodename: #document (value: version="1.0" encoding="ISO-8859-1"
try it"
Document Object