Text - Web APIs | MDN

Constructor

Text()

Returns a new Text node with the parameter as its textual content.

Instance properties

Inherits properties from its parents, CharacterData, Node, and EventTarget.

Text.assignedSlot Read only

Returns a HTMLSlotElement representing the <slot> the node is inserted in.

Text.wholeText Read only

Returns a string containing the text of all Text nodes logically adjacent to this Node, concatenated in document order.

Instance methods

Inherits methods from its parent, CharacterData, Node, and EventTarget.

Text.splitText

Breaks the node into two nodes at a specified offset.

Specifications

Specification
DOM
# interface-text

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.