Is there a way to select nth-level children in CSS/jQuery without using any ID or class references, only tag names?
I know how to get first level children with the selector div#block > div
. But I am looking for a solution to target deeper levels.
<div id="block">
<div>level 1
<div>level 2</div>
<div>level 2
<div>level 3</div>
<div>level 3</div>
</div>
<div>level 2
<div>level 3
<div>level 4</div>
</div>
<div>level 3</div>
</div>
</div>
<div>level 1
<div>level 2
<div>level 3
<div>level 4</div>
</div>
<div>level 3</div>
</div>
<div>level 2</div>
</div>
<div>level 1
<div>level 2</div>
<div>level 2
<div>level 3</div>
<div>level 3</div>
</div>
<div>level 2
<div>level 3</div>
<div>level 3</div>
</div>
<div>level 2</div>
</div>
</div>