I thought the closer () function would do this for me, but it seems not. I have the following markup, and I want to add the class to all the parent anchors using the class trigger:
<ul>
<li class="selected">
<a class="trigger" href=""></a>
<a href=""></a>
<ul>
<li class="selected">
<a class="trigger" href=""></a>
<a href="" id = "my_target"></a>
</li>
</ul>
</li>
</ul>
I want to choose my goal - in this example - the deepest anchor, and then add a class to each a.trigger in my descendants. What would be the best way to do this? Thank.
source
share