<div id="formheadtop">
<input class="checkbox" type="checkbox" /></div><div class="formbody"></div>
<div id="formheadtop">
<input class="checkbox" type="checkbox" /></div><div class="formbody"></div>
<div id="formheadtop"><input class="checkbox" type="checkbox" /></div><div class="formbody"></div>
$(function() { $('input:checkbox').live('click', function () {
if ( $(this).attr('checked') == true )
{
$(this).nextAll('.formbody:first').fadeIn();
}
else
{
$('.formbody').fadeOut();
};
});
The Code doesn't work. I want to fade out only the next div.formbody.