function getFids(){
fids="";
$('input[name="chBox"]:checked').each(function(){
fids+=$(this).val()+",";
});
fids=fids.substring(0,fids.length-1);
alert(fids);
}
function getAllFids(){
fids="";
if($('input[name="allBox"]').attr("checked")){//全选判定全选菜单是否选中
$('input[name="chBox"]').each(function(){
$(this).attr("checked",true);
//alert($(this).attr("checked"));
fids+=$(this).val()+",";
fids=fids.substring(0,fids.length-1);
});
}
else{
$('input[name="chBox"]').each(function(){//遍历所有name位chBox的复选框
$(this).attr("checked",false);
//alert($(this).attr("checked"));
fids="";
});
}
//fids=fids.substring(0,fids.length-1);
//alert(fids);
}
input之checkbox用法
最新推荐文章于 2024-04-01 19:33:10 发布