views:

68

answers:

1
$(".trigger").click(function () {
  $(this).next(".toggle").slideToggle("fast");
  $(this).toggleClass("active");
  return false
});

HTML:

<input type="checkbox" class="trigger">
<div class="toggle">content</div>

It isn't working, whats wrong with the code?

Thanks

+1  A: 

maybe put <div style="display:none" class="toggle"> to hide it first? also, return false is unnecessary (and is missing a semicolon)

also, is this function within your $(function() {}); ?

Jason
Ah, the problem was another plugin that was masking my checkbox with other elements. Fixed. Useful tips though, thanks
Nimbuz