Options
All
  • Public
  • Public/Protected
  • All
Menu

A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection().

Hierarchy

  • Selection

Index

Properties

anchorNode: null | Node
anchorOffset: number
focusNode: null | Node
focusOffset: number
isCollapsed: boolean
rangeCount: number
type: string

Methods

  • addRange(range: Range): void
  • Parameters

    Returns void

  • collapse(node: null | Node, offset?: number): void
  • Parameters

    • node: null | Node
    • Optional offset: number

    Returns void

  • collapseToEnd(): void
  • Returns void

  • collapseToStart(): void
  • Returns void

  • containsNode(node: Node, allowPartialContainment?: boolean): boolean
  • Parameters

    • node: Node
    • Optional allowPartialContainment: boolean

    Returns boolean

  • deleteFromDocument(): void
  • Returns void

  • empty(): void
  • Returns void

  • extend(node: Node, offset?: number): void
  • Parameters

    • node: Node
    • Optional offset: number

    Returns void

  • getRangeAt(index: number): Range
  • Parameters

    • index: number

    Returns Range

  • removeAllRanges(): void
  • Returns void

  • removeRange(range: Range): void
  • Parameters

    Returns void

  • selectAllChildren(node: Node): void
  • Parameters

    Returns void

  • setBaseAndExtent(anchorNode: Node, anchorOffset: number, focusNode: Node, focusOffset: number): void
  • Parameters

    • anchorNode: Node
    • anchorOffset: number
    • focusNode: Node
    • focusOffset: number

    Returns void

  • setPosition(node: null | Node, offset?: number): void
  • Parameters

    • node: null | Node
    • Optional offset: number

    Returns void

  • toString(): string
  • Returns string

Generated using TypeDoc