title: jquery focus first form element on tab of final
body: <p>I am trying to get the cursor to jump to focus on the first element of the form.  For some reason it keeps getting focus on the 2nd element instead of the first.  I did just a simple form.</p>
  
  <pre><code>&lt;form&gt;
    &lt;input type="text"&gt;
    &lt;input type="text"&gt;
    &lt;input type="text"&gt;
    &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  
  $('form').children().keydown(function(e) {
  if (e.keyCode == 9 || e.which == 9) {
         if ($(this).is(':last-child')) {
           $(this).parent().children().first().focus();
         }
  }
  })
  </code></pre>