XML DOM appendData() Method
Text Object
Definition and Usage
The appendData() method adds a string to the end of a text node.
Syntax
textNode.appendData(string)
| Parameters | Description |
|---|---|
| string | Required. The string to add to the text node. |
Example
The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and to the first
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0].childNodes[0];
x.appendData(" Cooking");
document.write(x.data);
Output:
Everyday Italian Cooking
Try it »
Text Object