I have a table with a checkbox in each row and a button below it. I want to disable the button if at least one checkbox is checked.
-
Try this:
$('tbody').click(function () {
if ($('.myCheckBox:checked').length >= 1) {
$('#confirmButton').prop("disabled", true);
}
else {
$('#confirmButton').prop("disabled", false);
}
});
DEMO
- 热议问题