I’m trying to select elements with jquery ionly on a specific level. They have to be directly sub of #main->table and contain the class x.
I’m trying something like that $('#main>table .column'); But with this i also get the second level div with the class “x” (total 3). I need just the two elements which are marked in the example with “wanted”. I’m unfortunately not able to make any changes on the code…
Maybe there is something possible like $('#main>table .column:first-child');? Somehow that returns me 3elements as well. Best would be a possibility to consider only a specific number of levels
<div id=main>
<div class=x> <!-- not wanted -->
<table>
<tr>
<td>
<div class=x> <!-- wanted -->
<table>
<tr>
<td>
<div class=x></div> <!-- not wanted -->
</td>
</tr>
</table>
</div>
</td>
<td>
<div class=x></div> <!-- wanted -->
</td>
</tr>
</table>
</div>
</div>
Thanks in advance for your help!
How about