I have this mark-up:
<b class="learn more">
Learn more <span class="closedTriangle">►</span><span class="openTriangle">▼</span>
</b>
and this jquery:
$('.learnMore').click(function() {
$(this).next().slideToggle('fast');
$('.learnMore + .closedTriangle').toggle();
$('.learnMore + .openTriangle').toggle();
});
I’ve tried wrapping the selector with $(this), but I see the mark-up is not in this context.
I was trying to use and adjacent selector but I’m not winning yet. I am trying to toggle the show/hide between the arrows but only within the specific context. I have numerous “learn More”‘s around the page so just selecting the classes would affect all of them on the page
demo jsBin
this parentlike:$('YourChildrenElementOf', this)HTML:
jQuery: