js 多选 反选

//$(".435__1").attr("checked", true);
//$(".435__0").removeAttr("checked");
$("."+pid+"__1").attr("checked", true);
$("."+pid+"__0:checked").removeAttr("checked");

$('input:checkbox').click(function () {
var projid_name = $(this).attr("name");
var projid_name_str= new Array(); //定义一数组
projid_name_str=projid_name.split("_");
pname_1 = projid_name_str[0]+"_"+projid_name_str[1]+"_1";
pname_0 = projid_name_str[0]+"_"+projid_name_str[1]+"_0";
if(projid_name_str[2]==1){
$("input[name="+pname_0+"]:checked").removeAttr("checked");
}else if(projid_name_str[2]==0){
$("input[name="+pname_1+"]:checked").removeAttr("checked");
}
});

/*
$("#435 :checkbox[checked]").each(function(i){
valArr[i] = $(this).val();
});
*/

上一篇:Editor扩展之查看Prefab用在那儿


下一篇:JAVA JDK 环境变量配置 入门详解 - 精简归纳