DekGenius.com
Team LiB   Previous Section   Next Section
Text a run of text in an HTML or XML document

Availability

DOM Level 1 Core

Inherits from/Overrides

Node figs/U2192.gif CharacterData figs/U2192.gif Text

Subinterfaces

CDATASection

Methods

splitText( )

Splits this Text node into two at the specified character position and returns the new Text node.

Description

A Text node represents a run of plain text in an HTML or XML document. Plain text appears within HTML and XML elements and attributes, and Text nodes typically appear as children of Element and Attr nodes. Text nodes inherit from CharacterData, and the textual content of a Text node is available through the data property inherited from CharacterData or through the nodeValue property inherited from Node. Text nodes may be manipulated using any of the methods inherited from CharacterData or with the splitText( ) method defined by the Text interface itself. Text nodes never have children.

See Node.normalize( ) for a way to remove empty Text nodes and merge adjacent Text nodes from a subtree of a document.

See Also

CharacterData, Node.normalize( )

Returned by

Document.createTextNode( ), Text.splitText( )

    Team LiB   Previous Section   Next Section