Is there a way to grab the first class, after a given class?
The code below only selects the first class (I’m aware of what first does) but I want it to select each first .FAQAnswers after each FAQName is this possible?
$(".FAQName").click(function () {
$('.FAQAnswers').first().toggle(200);
});
<div class="FAQName">Question</div>
...
<div class="FAQAnswers">Answer</div>
<div class="FAQName">Question</div>
...
<div class="FAQAnswers">Answer</div>
You need to find the needed element with
nextUntil: