Easy Tutorial
❮ Met Element Removeattributens Dom Httprequest ❯

XML DOM splitText() Method



Definition and Usage

The splitText() method splits a text node into two nodes at the specified offset.

This function returns a node containing the text after the offset.

The text before the offset remains in the original text node.

Syntax

Parameter Description
offset Required. Specifies where to split the text node. The offset starts at 0.

Example

The following code snippet uses loadXMLDoc() to load "books_cdata.xml" into xmlDoc and splits the text in the first CDATA node:

Example

Output:


❮ Met Element Removeattributens Dom Httprequest ❯