Firefox Tomorrow

web api interface

CaretPosition

View on MDN ↗

The CaretPosition interface represents the caret position, an indicator for the text insertion point. You can get a CaretPosition using the caretPositionFromPoint() method.

Instance properties

This interface doesn’t inherit any properties.

  • offsetNode Read only
    • : Returns a Node containing the found node at the caret’s position.
  • offset Read only
    • : Returns a long representing the offset of the selection in the caret position node. This will be the character offset in a text node or the selected child node’s index in an element node.

Instance methods

  • getClientRect
    • : Returns the client rectangle for the caret range.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also