I'm trying to setup a click event on a div, and I would like that event to fire if that div is clicked anywhere except a checkbox in the div. If the checkbox is clicked, I do not want the div's click event to fire. I setup a click event on the checkbox and returned false, which stops the div's click event, but does not allow the checkbox to become checked either. Here's what I have now:
$('.theDiv').click(function() {
// Click event for the div, I'm slide toggling something
$('.sub-div', $(this)).slideToggle();
});
$('.checkboxInTheDiv').click(function() {
// Do stuff for the checkbox click, but dont fire event above
return false; // returning false won't check/uncheck the box when clicked
})