Text interface represents a text
node in a DOM tree.
To understand what a text node is, consider the following document:
In that document, there are three text nodes, with the following contents:
Aliens?" (the contents of the
\n" (after the
</head> end tag, a newline followed by a space)
Why yes.\n" (the contents of the
Each of those text nodes is an object that has the properties and methods documented in this article.
Inherits properties from its parents,
Text.assignedSlot Read only
HTMLSlotElement representing the
<slot> the node is inserted in.
Text.wholeText Read only
DOMString containing the text of all
Text nodes logically adjacent to this
Node, concatenated in document order.
Inherits methods from its parent,
Replaces the text of the current node and all logically adjacent nodes with the specified text.
Breaks the node into two nodes at a specified offset.