Is it possible to programmatically detect the caret position within a <input type=text> element?
<p>Assuming a regular <code>&lt;input type=text&gt;</code> text-box with data in it.  </p>

<p>Is it possible to detect (via JavaScript) the position of the text-coursor inside that text-box?  </p>

<p>I am able to detect an ARROW LEFT or ARROW RIGHT keydown event - but how to detect the cursor location?  </p>

<p><em><strong>Why I need this:</em></strong>  </p>

<p>I have a dynamic text-box here: <a href="http://vidasp.net/tinydemos/dynamic-textbox.html" rel="nofollow">http://vidasp.net/tinydemos/dynamic-textbox.html</a><br>
It works great, however there are two scenarios that I would like to fix:  </p>

<ol>
<li>when the cursor is at the beginning of the text-box and the user presses BACKSPACE </li>
<li>when the cursor is at the end of the text-box and the user presses DELETE </li>
</ol>

<p>(In both cases, the text-box must contain data for the effect to be observable.)</p>
