我有一堆具有共同属性class="all"
的复选框,我想禁用除已选中的复选框之外的所有复选框,因为目前我无法取消选中它。此代码禁用 class="all"
中的所有复选框。如何从此代码中排除当前选中的复选框,以便取消选中它?
$('.all').click(function() {
$('.all').attr('disabled', $(this).is(':checked'));
});
最佳答案
$('.all').click(function() {
$('.all').not(this).attr('disabled', $(this).is(':checked'));
});
关于javascript - 不要禁用选中的复选框jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10824654/