XML DOM appendData()Methods
CDATA object
Definition and Usage
The appendData() method adds data to the end of a CDATA node.
Syntax
CDATANode.appedData(string)
| Parameter | Description |
|---|---|
| string | Required. The string to be added to the CDATA node. |
Example
The following code snippet usesloadXMLDoc()put "books_cdata.xmlLoad into xmlDoc and append text to the first <html> element:
Example
xmlDoc=loadXMLDoc("books_cdata.xml");
x=xmlDoc.getElementsByTagName("html")[0].childNodes[0];
x.appendData(" Wonderful!");
document.write(x.data);
x=xmlDoc.getElementsByTagName("html")[0].childNodes[0];
x.appendData(" Wonderful!");
document.write(x.data);
Output:
Stunning! Wonderful!
Try it Yourself »
CDATA objectother extensions