I need some help with jquery. How to get the .content after I click on the .slider ? I want then to call the .slideToggle() function
<div class='details'>
<div>
<a href='#' class='slider'>my link</a>
</div>
<div class='content'>
some content
</div>
</div>
you could do either of these
$(".details a.slider").click(function(){ $(this).parent().children(".content").slideToggle(); });or (think this should work too)
$(".details a.slider").click(function(){ $(this).siblings(".content").slideToggle(); });