Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 534603 of CaretPosition

  • Revision slug: Web/API/CaretPosition
  • Revision title: CaretPosition
  • Revision id: 534603
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{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")}}

Revision Source

<p>{{SeeCompatTable}}</p>
<p>{{ APIRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>CaretPosition</code> interface represents the caret postion, an indicator for the text insertion point. You can get a <code>CaretPosition</code> using the {{domxref("document.caretPositionFromPoint")}} method.</p>
<h2 id="Properties">Properties</h2>
<p><em>This interface doesn't inherit any property.</em></p>
<dl>
 <dt>
  {{domxref("CaretPosition.offsetNode")}} {{readonlyInline}}</dt>
 <dd>
  Returns a {{domxref("Node")}} containing the found node at the caret's position.</dd>
 <dt>
  {{domxref("CaretPosition.offset")}} {{readonlyInline}}</dt>
 <dd>
  Returns a <code>long</code> representing the character offset in the caret position node.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>This interface doesn't implement or inherit any method.</em></p>
<h2 id="Specification" name="Specification">Specification</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSSOM View', '#caret-position', 'CaretPosition') }}</td>
   <td>{{ Spec2('CSSOM View') }}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatGeckoDesktop("20.0") }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatGeckoMobile("20.0") }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li>{{domxref("Document.caretPositionFromPoint()")}}</li>
 <li>{{domxref("Range")}}</li>
 <li>{{domxref("Node")}}</li>
</ul>
Revert to this revision