title: How to prevent insertion point from changing its position in an input element when pressing arrows?
body: <p>I have an auto-complete box where user can choose between results with arrow keys while the <code>input</code> element is in focus. when the user uses up and down arrows, the insertion point jumps between the start and the end of the text. How can I prevent this from happening? I tried the following but it does not work:</p>
  
  <pre><code>    $("#Hdr_nav_search_input").keypress(function(event){
          if(event.which==38 || event.which==40){
                  event.preventDefault();     
          }
      })
  </code></pre>