title: javascript prevent cursor to move
body: <p>Into an input box, I want to <strong>stop the propagation of the cursor</strong> just as I type on the up key "&uarr;" :</p>
  
  <p>Before :</p>
  
  <p><code>tes|t</code> // cursor is before <em>t</em></p>
  
  <p>After : </p>
  
  <p><code>|test</code> // cursor went beginning</p>
  
  <p>I want to prevent the cursor to move, so it has to stay before <em>t</em>.</p>
  
  <p>So far, I'm trying with this, but it doesn't work : </p>
  
  <pre><code>$('input').keyup(function(e) {
  
      if (e.which == 40) { // up key
          e.stopPropagation();
          e.stopImmediatePropagation();
          e.preventDefault();
  
          // actions
  
          return false;
      }
  
  }
  </code></pre>
  
  <p>Is this possible anyway ?</p>