Selecting first anchor inside li element using jQuery
My HTML looks like this:
<li class="li-top"><a class="top sub" href=#>Blah</a> .... </li>
I am trying to select an anchor tag to change the color of the text (“Blah”). But here's the catch: I use closest () because I start with a descendant of this li tag:
$(this).closest('li.li-top');
How to get this anchor tag from this starting point? I tried next (), each (), children (), etc. I can’t get it. Thank you
+7
sqlman
source share