Summary
The CaretPosition
interface represents the caret postion, an indicator for the text insertion point. You can get a CaretPosition
using the {{domxref("document.caretPositionFromPoint")}} method.
Attributes
-
offsetNode
-
Read only; of type {{domxref("Node")}}. Returns the found node at the caret's position.
-
offset
-
Read only; of type long. Returns the character offset in the caret position node.
Specification
Specification |
Status |
Comment |
{{ SpecName('CSSOM View', '#caret-position', 'CaretPosition ') }} |
{{ Spec2('CSSOM View') }} |
|
Browser compatibility
{{ CompatibilityTable() }}
Feature |
Chrome |
Firefox |
Internet Explorer |
Opera |
Safari |
Basic support |
{{ CompatNo() }} |
{{ CompatGeckoDesktop("20.0") }} |
{{ CompatNo() }} |
{{ CompatNo() }} |
{{ CompatNo() }} |
Feature |
Android |
Firefox Mobile |
IE Phone |
Opera Mobile |
Safari Mobile |
Basic support |
{{ CompatNo() }} |
{{ CompatGeckoMobile("20.0") }} |
{{ CompatNo() }} |
{{ CompatNo() }} |
{{ CompatNo() }} |
See also
- {{domxref("document.caretPositionFromPoint")}}
- {{domxref("Range")}}
- {{domxref("Node")}}