Need help selecting the class "details" under a parent class "two"
when class "trigger" is clicked.

$().ready(function(){
   $('.trigger").click(function(event){
        var thisItem = $(this).parent(); // set thisItem to .two
        $(thisItem).$('.details').slideToggle();  // toggle .details in .two
   })
})
<div class="one">
  <div class="two"><span class="trigger">trigger</span>
    <div class="details">some stuff</div>
  </div>
</div>
<div class="one">
  <div class="two"><span class="trigger">trigger</span>
     <div class="details">some stuff</div>
  </div>
</div>
<div class="one">
 <div class="two"><span class="trigger">trigger</span>
    <div class="details">some stuff</div>
  </div>
</div>

Reply via email to