Check if a Checkbox is checked
This question already has an answer here:
Try This :-
$('.cbFee').click(function () {
if ($(this).is(':checked')) {
$('.grpAnnualFee').hide();
} else {
$('.grpAnnualFee').show();
}
});
OR
$('.cbFee').click(function () {
if (this.checked) {
$('.grpAnnualFee').hide();
} else {
$('.grpAnnualFee').show();
}
});
and while dealing with checkboxes it is better to use .change()
instead of .click()
.
你可以使用$('.cbFee').is(':checked')
上一篇: 使用WCF的MSMQ监听器
下一篇: 检查复选框是否被选中