XML DOM dataProperty
CDATA object
Definition and Usage
The data property returns the data of the selected node.
Syntax
CDATANode.data
Example
The following code snippet usesloadXMLDoc()put "Load into xmlDoc, and get data from all <html> elements:
Example
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 Yourself »
CDATA objectother extensions