jQuery: find() children until a certain threshold element is encountered
<p>I have a nested table structure like</p>

<pre><code>   &lt;table&gt;

       &lt;td id="first"&gt;

           &lt;div class="wrapper"&gt;
               &lt;input name=1&gt;
           &lt;/div&gt;

           &lt;input name=2&gt;

           &lt;table&gt;

               &lt;td id="second"&gt;

                   &lt;input name=3&gt;
</code></pre>

<p>I have jQuery selection <code>$("#first")</code>. I'd like to traverse and <code>find()</code> all children <code>&lt;input&gt;s</code> within this <code>&lt;td&gt;</code> context, but not to descent into the nested <code>&lt;table&gt;</code>s.</p>

<p>So I need a jQuery trick which</p>

<ul>
<li><p>Will <code>find()</code> all children elements of a certain element</p></li>
<li><p>Will descent n levels down in DOM tree</p></li>
<li><p>But will stop descending if certain a element (<code>&lt;table&gt;</code>) is encountered, so that the selector doesn't select inputs of a nested tables (which will be handled separately)</p></li>
<li><p>There could be any number of nested <code>&lt;table&gt;</code> levels, so the solution should work no matter how many parent <code>&lt;table&gt;</code> or children <code>&lt;table&gt;</code> are encountered within the scope of $("#first") <code>&lt;td&gt;</code> or any other <code>&lt;td&gt;</code></p></li>
</ul>

<p>I checked other jQuery find until questions. They have answers, but seems like they do not fill the last criteria</p>
