Javascript, avoid cursor moving at textbox end
<p>I have a js funciton executed at one textbox OnKeyUp event.</p>

<p>The textbox has a value by default.</p>

<p>If I place my cursor in the middle of the string and I add a char, the cursor moves at the end of the string.</p>

<p>I know that this is because the executed function recalculate and set the textbox value.</p>

<p>Is there a way to avoid the cursor moving at the end of the string?</p>

<p>Thanks</p>
