title: simple textarea string replace jquery script
body: <p>I'm trying to make some simple jquery script that replaces a specific string in the textarea. I've got this know:</p>
  
  <pre><code>$("textarea").bind("keyup", function() {
      var text = $(this).val();
      text = text.replace(/,,/g, "′");
      $(this).val(text);
  });
  </code></pre>
  
  <p>This replaces <code>,,</code> into the unicode symbol <code>′</code>. This works, except that the cursors position moves to the last character of the textarea everytime there is a replacement. I want that the cursors goes just after the <code>′</code> when there is a replacement. How could I do this ?</p>
  
  <p>Here is my jsfiddle: <a href="http://jsfiddle.net/zvhyh/" rel="nofollow">http://jsfiddle.net/zvhyh/</a></p>
  
  <p>Edit: thanks for the help guys. I use this now:
  <a href="http://jsfiddle.net/zvhyh/14/" rel="nofollow">http://jsfiddle.net/zvhyh/14/</a></p>