I have a grid of team members that are all built in figures with figcaptions. I want to trigger the click function for only the one that has been clicked currently it applies the click function to all the figures.
HTML ex:)
<section class="l-team-grid clearfix">
<h2>OUR TEAM</h2>
<figure class="team-items">
<img src="../images/employee-one.jpg" alt="">
<hr>
<figcaption>
<h3 class="team-member-name">John Doe</h3>
<p>John is a college graduate he loves milk cookies and broccoli. He is 25 years old and loves architecture.</p>
</figcaption>
<hr>
</figure>
<figure class="team-items">
<img src="../images/employee-one.jpg" alt="">
<hr>
<figcaption>
<h3 class="team-member-name">John Doe</h3>
<p>John is a college graduate he loves milk cookies and broccoli. He is 25 years old and loves architecture.</p>
</figcaption>
<hr>
</figure>
<figure class="team-items">
<img src="../images/employee-one.jpg" alt="">
<hr>
<figcaption>
<h3 class="team-member-name">John Doe</h3>
<p>John is a college graduate he loves milk cookies and broccoli. He is 25 years old and loves architecture.</p>
</figcaption>
<hr>
</figure>
current Jquery I have for click function
$('.team-items p').fadeOut(10);
$('.team-member-name').click(function(){
$('.team-member-name + p').toggle(700);
});
I know why the selector is wrong and triggering all the p's to show but just cant figure out the selector to trigger the event only on the adjacent paragraph of the clicked h3. Possible something to do with this?
Thanks