Jquery 当其他行中的所有复选框都隐藏时,需要隐藏表头中的复选框
当其他行中的所有复选框都隐藏时,需要隐藏表头中的复选框Jquery 当其他行中的所有复选框都隐藏时,需要隐藏表头中的复选框,jquery,css,Jquery,Css,当其他行中的所有复选框都隐藏时,需要隐藏表头中的复选框 if ($('#Submit').css('display', 'none')) { $("#chselect").hide(); } else if($('#Submit').css('display') == 'none'){
if ($('#Submit').css('display', 'none')) {
$("#chselect").hide();
}
else if($('#Submit').css('display') == 'none'){
$("#chselect").show();
}
你的答案很简单,我的朋友: 1-首先,您需要添加类,并将其称为
复选框
,添加到除标题复选框之外的所有复选框中
2-将idmain复选框添加到标题的复选框中
3-添加此代码
$(".checkboxes").change(function() {
var flag = false;
$(".checkboxes").each(function () {
if ($(this).is(':checked')) {
flag = true;
}
});
if(flag == true)
{
$('#mainCheckBox').attr('checked', "checked");
}
else
{
$('#mainCheckBox').removeAttr("checked");
}
});