XML DOM data attribute
Definition and Usage
data property returns the data of the selected node.
grammar
CDATANode.data
Examples
The following code fragment uses loadXMLDoc () to " books_cdata.xml " into xmlDoc, and get data from all <html> element:
Examples
xmlDoc=loadXMLDoc("books_cdata.xml");
x=xmlDoc.getElementsByTagName("html");
for (i=0;i<x.length;i++)
{
document.write(x[i].childNodes[0].data);
document.write("
");
}
x=xmlDoc.getElementsByTagName("html");
for (i=0;i<x.length;i++)
{
document.write(x[i].childNodes[0].data);
document.write("
");
}
The code above will output:
try it"
CDATA objects