I have a nested table structure like
<table>
<td id="first">
<div class="wrapper">
<input name=1>
</div>
<input name=2>
<table>
<td id="second">
<input name=3>
I have jQuery selection $("#first"). I'd like to traverse and find() all children <input>s within this <td> context, but not to descent into the nested <table>s.
So I need a jQuery trick which
Will
find()all children elements of a certain elementWill descent n levels down in DOM tree
But will stop descending if certain a element (
<table>) is encountered, so that the selector doesn't select inputs of a nested tables (which will be handled separately)There could be any number of nested
<table>levels, so the solution should work no matter how many parent<table>or children<table>are encountered within the scope of $("#first")<td>or any other<td>
I checked other jQuery find until questions. They have answers, but seems like they do not fill the last criteria