Web/API/CaretPosition

From Get docs

This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.


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

Properties

This interface doesn't inherit any properties.

CaretPosition.offsetNode Read only
Returns a Node containing the found node at the caret's position.
CaretPosition.offset Read only
Returns a long representing the character offset in the caret position node.

Methods

CaretPosition.getClientRect

Specification

Specification Status Comment
CSS Object Model (CSSOM) View ModuleThe definition of 'CaretPosition' in that specification. Working Draft

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

CaretPosition

Experimental'

Chrome

No support No

Edge

No support No

Firefox

Full support 20

IE

No support No

Opera

No support No

Safari

No support No

WebView Android

No support No

Chrome Android

No support No

Firefox Android

Full support 20

Opera Android

No support No

Safari iOS

No support No

Samsung Internet Android

No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.


See also