Easy Tutorial
❮ Dom Tutorial Prop Text Data ❯

XML DOM splitText() Method



Definition and Usage

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

This function returns the 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.xml" into xmlDoc and splits the text node after the first word:

Example

Output:


❮ Dom Tutorial Prop Text Data ❯