Latest web development tutorials

XML DOM appendData () method

CDATA Object Reference CDATA objects

Definition and Usage

appendData () method to add data to the end of the CDATA node.

grammar

CDATANode.appedData(string)

参数 描述
string 必需。向 CDATA 节点添加的字符串。


Examples

The following code fragment uses loadXMLDoc () to " books_cdata.xml " into xmlDoc to the first <html> append text elements:

Examples

xmlDoc=loadXMLDoc("books_cdata.xml");

x=xmlDoc.getElementsByTagName("html")[0].childNodes[0];

x.appendData(" Wonderful!");
document.write(x.data);

Output:

Stunning!Wonderful!

try it"

CDATA Object Reference CDATA objects