title: Stop cursor from jumping to end of input field in javascript replace
body: <p>I'm using a regular expression to strip invalid characters out of an text input area in javascript (running in IE). I run the replace function on every keyup event. However, this makes the cursor jump to the end of the text box after each keypress, which makes inline editing impossible. </p>
  
  <p>Here is it in action:</p>
  
  <p><a href="http://jsbin.com/ifufuv/2" rel="noreferrer">http://jsbin.com/ifufuv/2</a></p>
  
  <p>Does anyone know how to make it so the cursor does not jump to the end of the input box?</p>