A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Text below:

Text - Web APIs | MDN

Text

Baseline Widely available *

The Text interface represents a text node in a DOM tree.

EventTarget Node CharacterData Text

To understand what a text node is, consider the following document:

<html lang="en" class="e">
  <head>
    <title>Aliens?</title>
  </head>
  <body>
    Why yes.
  </body>
</html>

In that document, there are five text nodes, with the following contents:

Each of those text nodes is an object that has the properties and methods documented in this article.

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 Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3