Interface ReadonlyTextRange

A fragment of a document that can contain only pieces of a single text node. Does not implement Range methods that operate with other nodes or directly mutate the contents of the Range.

Hierarchy

  • AbstractRange
  • Pick<Range, "commonAncestorContainer" | "cloneContents" | "collapse" | "getBoundingClientRect" | "getClientRects" | "toString">
    • ReadonlyTextRange

Implemented by

Properties

collapsed: boolean

Returns true if range is collapsed, and false otherwise.

MDN Reference

endContainer: Node

Returns range's end node.

MDN Reference

endOffset: number

Returns range's end offset.

MDN Reference

startContainer: Node

Returns range's start node.

MDN Reference

startOffset: number

Returns range's start offset.

MDN Reference

commonAncestorContainer: Node

Returns the node, furthest away from the document, that is an ancestor of both range's start node and end node.

MDN Reference

Methods

  • The range only operates on a single Text node, so only the offsets can be set.

    Parameters

    • offset: number

    Returns void

  • The range only operates on a single Text node, so only the offsets can be set.

    Parameters

    • offset: number

    Returns void

  • Returns DocumentFragment

  • Parameters

    • Optional toStart: boolean

    Returns void

  • Returns DOMRect

  • Returns DOMRectList

  • Returns string

Generated using TypeDoc