title: jquery selector: how to focus on the next input in a table cell?
body: <p>I got a form where all textbox and select inputs are in different <code>&lt;td&gt;</code> in one <code>&lt;tr&gt;</code>.</p>
  
  <p>The selection of the first <code>&lt;select&gt;</code> will decide which textboxes will be visible in the following <code>&lt;td&gt;</code>s. So I am to reload the whole <code>&lt;tr&gt;</code> ajaxly and then focus on the next <code>&lt;input&gt;</code>.</p>
  
  <p>My current JavaScript:</p>
  
  <pre><code>var $nextAll = $('#ExpenseTypeId').closest('td').nextAll('td');
  </code></pre>
  
  <p>And then check if the <code>&lt;td&gt;</code> has an <code>&lt;input&gt;</code> inside. In a <code>for</code> loop, I detect which one is my next <code>&lt;input&gt;</code>, which will have focus.</p>
  
  <p>But, is there an easy way to do that? I hope to have something like:</p>
  
  <pre><code>$('#ExpenseTypeId').closest('td').nextAll('td input').first().focus();
  </code></pre>
  
  <p>Obviously the <code>nextAll('id input')</code> does not work as supposed. How to write a correct selector?</p>