How to determine where cursor is in a string in a form element?
<p>I have an input.</p>

<pre><code>&lt;input name="inputName" id="inputId" value="Hello" /&gt;
</code></pre>

<p>Lets pretend that the cursor is after the e in hello, like so:</p>

<pre><code>He|llo
</code></pre>

<p>How can I determine the position of the cursor within that string?  Meaning, how can I make it tell me that the cursor is right after string{1} (or before string{2})?</p>

<p><strong>Edit:</strong> Really though, my end goal is determine if the cursor is at the end of the string.  I don't need to know if its in the middle.  If it's at the end of the string, I am capturing arrow presses and will make it jump to the next form element.  If it's at the beginning or middle, then I am not making that jump to the next form element.  Jumping around on arrow presses works already, but it jumps irregardless of where the cursor is in the string.</p>
