I want to select the tag a only which inside my-div.
<div id="my-div">
<li><a class="class1" href="href">text1</a>
<ul class="ul-internal">
<li><a href="....">....</a></li>
<li><a href="....">....</a></li>
</ul>
</li>
</div>
What I’m doing now is $("div#my-div li a") and it returns all tags inside first li.
Your suggestions?
You can use
$('#my-div >li a');If you want to select only the first
atag then you would want to useSee Demo