I have a series of content and header divs to display some data. In addition each header has a checkbox.
<div id="content-1">
<div class="head"><input type="checkbox" name="check-1"/> Header</div>
<div class="content">Content</div>
</div>
<div id="content-2">...</div>
<div id="content-3">...</div>
I use to following jQuery to show/hide a content div by clicking on the respective header div.
$(".head").toggle(
function(){ $(this).nextAll().slideDown('200'); },
function(){ $(this).nextAll().slideUp('200'); }
);
The problem is that clicking the checkbox shows/hides the content div and the checkbox can not be checked/unchecked. I want the content toggle to only occur when clicking the head div, and for the checkbox to function as normal.
Any help greatly appreciated.