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

Properties

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

Methods

  • Parameters

    Returns void

  • Parameters

    • node: Node
    • Optional offset: number

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • node: Node
    • Optional allowPartialContainment: boolean

    Returns boolean

  • Returns void

  • Returns void

  • Parameters

    • node: Node
    • Optional offset: number

    Returns void

  • Parameters

    • index: number

    Returns Range

  • Parameters

    • Optional alter: string
    • Optional direction: string
    • Optional granularity: string

    Returns void

  • Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

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

    Returns void

  • Parameters

    • node: Node
    • Optional offset: number

    Returns void

  • Returns string