Answer the question
In order to leave comments, you need to log in
Why do checkboxes work incorrectly?
I have checkboxes:
<label><input type="checkbox"> 1 </label>
<label><input type="checkbox"> 2 </label>
<label><input type="checkbox"> 3 </label>
<label><input type="checkbox"> 4 </label>
function(e) {
if ($(this).find('input').prop('checked')) {
$(this).find('input').prop('checked', false);
} else {
$(this).find('input').prop('checked', true);
}
}
Answer the question
In order to leave comments, you need to log in
Why do you need this handler? When you click on the label, the associated checkbox is automatically checked without it, but this action is performed twice (when you click on the checkbox) and nothing happens.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question