X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

XML DOM appendData() Method


CDATA Object Reference CDATA Object

Definition and Usage

The appendData() method adds data at the end of a CDATA node.

Syntax

CDATANode.appedData(string)

Parameter Description
string Required. The string to add to the CDATA node


Example

The following code fragment loads "books_cdata.xml" into xmlDoc using loadXMLDoc() and appends 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);

Output:

Stunning! Wonderful!

Try it yourself »

CDATA Object Reference CDATA Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook