Easy Tutorial
❮ Dom Met Node Removechild Met Element Getattributens ❯

XML DOM deleteData() Method



Definition and Usage

The deleteData() method removes data from a comment node.

Syntax

Parameter Description
start Required. Specifies where to start removing data. The start value is 0-based.
length Required. Specifies how many characters to delete.

Example

The following code snippet uses loadXMLDoc() to load "books_comment.xml" into xmlDoc and removes some characters from the first comment node:

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 Met Node Removechild Met Element Getattributens ❯