Easy Tutorial
❮ Dom Nodes Set Dom Prop Node Nextsibling ❯

XML DOM replaceData() Method



Definition and Usage

The replaceData() method replaces data within a CDATA node.

Syntax

Parameter Description
start Required. Specifies where to replace the characters. The starting value is 0.
length Required. Specifies how many characters to replace.
string Required. Specifies the string to insert.

Example

The following code snippet uses loadXMLDoc() to load "books_cdata.xml" into xmlDoc and replaces "Stunning" with "Fantastic" in the CDATA node of the first <html> element:

Example

Output:


❮ Dom Nodes Set Dom Prop Node Nextsibling ❯