splitText: offset
Splits a Text
node into two adjacent Text
nodes. The contents of the original node are divided at the given
split offset, with the second substring used as the new node's
value. The first substring remains in the original node. If the
node is currently linked into the DOM tree, the new node with the
split content becomes the next sibling of the original node. A new
Text
node containing the second
part of the split data is returned.
Raised if the offset given is < 0 and >= the
length
attribute.
Raised if the element is read-only.
// Make one Text node = doc.createTextNode("This text is split."); // and split it Text ndSplit = ndText.splitText(9);
Text
is a subclass of
the CharacterData
interface.
See the CharacterData
interface section in this chapter for a list of applicable
methods for accessing character data in nodes of this
type.