Skip to content

Type Editor


Type Editor / @type-editor/dom-util / text-nodes-after

text-nodes-after

Functions

FunctionDescription

textNodeAfter

Finds the text node after a given position in the DOM tree.

Traverses the DOM tree forward from the given position to find the nearest following text node. Stops at non-editable elements and block boundaries.

Example

typescript
const element = document.getElementById("myElement");
const textNode = textNodeAfter(element, 0);