title: How can I automatically tab to the next field using jQuery?
body: <p>In jQuery, how can I trigger the behavior of a user tabbing to the next input field?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>var e = jQuery.Event("keydown");
  e.which = 9; // # Key code for the Tab key
  $("input").trigger(e);
  </code></pre>
  
  <p>But triggering the event doesn't move the cursor to the next field. </p>
  
  <p>I suppose I could move the cursor manually using <code>focus()</code>, but deciding which field should be next is something the browser already knows how to do, so it seems much cleaner to just trigger a tab.</p>
  
  <p>Any ideas?</p>