title: JQuery can't change focus on keydown
body: <p>I'm trying to change the focus  whenever a user presses tab on the last field. I want to set the focus on to another input field.</p>
  
  <p>I have the following javascript code:</p>
  
  <pre><code>$("#input2").keydown(
    function() 
    {
      if(event.which == 9)
      {
        $("#input1").focus();
      }
    }
  );
  </code></pre>
  
  <p>And this is my trial html code:</p>
  
  <pre><code>&lt;div id="inputArea1"&gt;
    &lt;input id="input1" /&gt;
    &lt;input id="input2" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It seems to work with keyup (the changing the focus part) but then again I don't get what I want with keyup..</p>
  
  <p>What am I missing?</p>