Easy Tutorial
❮ Dom Prop Document Implementation Dom Met Element Setattributenode ❯

XML DOM appendData() Method



Definition and Usage

The appendData() method adds data to the end of a comment node.

Syntax

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

Example

The following code snippet uses loadXMLDoc() to load "books_comment.xml" into xmlDoc and appends text to the first comment element:

Example

Output:

In the above example, we use a loop and an if statement to perform processing specifically for comment nodes. The node type for comment nodes is 8.


❮ Dom Prop Document Implementation Dom Met Element Setattributenode ❯