I have the following code example: http://jsfiddle.net/sX3w9/
$('.item').on('click', function() {
var checkbox = $(this).find('input');
checkbox.attr("checked", !checkbox.attr("checked"));
$(this).toggleClass('selected');
});
Where a user should be able to click the div.item and/or the checkbox inside it and it should check or uncheck the checkbox and add or remove the selected class from the div.
It works when clicking the div, but clicking the checkbox instantly unchecks it again...