Easy Tutorial
❮ Met Element Removechild Dom Tutorial ❯

XML DOM substringData() Method



Definition and Usage

The substringData() method retrieves a string from a CDATA node.

Syntax

Parameter Description
start Required. Specifies where to start extracting characters. The starting value is 0.
length Required. Specifies how many characters to extract.

Example

The following code snippet uses loadXMLDoc() to load "books_cdata.xml" into xmlDoc and retrieves the string "Stun" from the first CDATA element:

Example

Output:


❮ Met Element Removechild Dom Tutorial ❯