CaretPosition
The CaretPosition interface represents the caret position, an indicator for the text insertion point. You can get a CaretPosition using the Document.caretPositionFromPoint() method.
Methods
getClientRect()
getClientRect(): DOMRect | null;
The getClientRect() method of the CaretPosition interface returns the client rectangle for the caret range.
Returns
DOMRect | null
Properties
offset
readonly offset: number;
The offset property of the CaretPosition interface returns an integer representing the offset of the selection in the caret position node.
offsetNode
readonly offsetNode: Node;
The offsetNode property of the CaretPosition interface returns a Node containing the found node at the caret's position.