{{SeeCompatTable}}
{{ APIRef() }}
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.
Properties
This interface doesn't inherit any property.
- {{domxref("CaretPosition.offsetNode")}} {{readonlyInline}}
- Returns a {{domxref("Node")}} containing the found node at the caret's position.
- {{domxref("CaretPosition.offset")}} {{readonlyInline}}
-
Returns a
long
representing the character offset in the caret position node.
Methods
This interface doesn't implement or inherit any method.
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")}}