Im trying to select one sibling div element with jquery to apply a slideToggle
I tried targeting the parent element, and then using .find(), also tried with siblings but not sure what im doing wrong.
<div class="col teachers-container px-0">
<div class="row py-2 teacher-box m-1 shadowed" >
<div class="teacher-card col center-block">
</div>
</div>
<div class="teacher-intro row px-lg-0" style="">
<h6 class="paragraph text-justify pb-3 mx-3 pt-1 pt-lg-2" style="">Intro text.</h6>
</div>
</div>
What i would like ideally but not working:
$('.teacher-box').on('click', () => {$(this).parent().children().last().slideToggle()})
This one is Working but all elements with teacher-intro class in other boxes get the slide toggle and i want to target only the one in the current box:
$('.teacher-box').on('click', () => {$('.teacher-intro').slideToggle()})