title: Caret position in pixels in an input type text (not a textarea)
body: <p><strong>UPDATE</strong>: duplicate of <a href="https://stackoverflow.com/questions/6930578/get-cursor-or-text-position-in-pixels-for-input-element">Get cursor or text position in pixels for input element</a>.</p>
  
  <p><strong>TL; DR</strong> - use the incredibly lightweight and robust <a href="https://github.com/component/textarea-caret-position/releases/tag/2.0.0" rel="noreferrer">textarea-caret-position</a> <em>Component</em> library, which now supports <code>&lt;input ype="text"&gt;</code> as well. Demo at <a href="http://jsfiddle.net/dandv/aFPA7/" rel="noreferrer">http://jsfiddle.net/dandv/aFPA7/</a></p>
  
  <hr>
  
  <p>Is there a way to know where the caret is inside an HTML text field?</p>
  
  <pre><code>&lt;input type='text' /&gt; 
  </code></pre>
  
  <p>I would like to position in pixels (and reposition) a div depending on the position of the caret.</p>
  
  <blockquote>
    <p><strong><em>Note</strong>: I don't want to know the position in characters or in a <code>&lt;textarea&gt;</code>. I want to know position in pixels in an <code>&lt;input&gt;</code> element.</em></p>
  </blockquote>