I have this check box:
<div class="OuterDiv">
<div class="InnerDiv">
<input type="checkbox" name="tie" value="tie">Error in tie score<br>
</div>
</div>
I have this jquery to toggle the checkbox:
$(document).ready(function() {
$('.OuterDiv').click(function() {
if ($(this).find('input:checkbox').is(':checked')) {
$(this).find('input:checkbox').attr('checked',false);
} else {
$(this).find('input:checkbox').attr('checked',true);
}
});
});
This seems to work, to toggling the checkbox when clicking on the div. However when I click the checkbox itself, nothing happens and it does not toggle.