//全选 function CheckAll() { ids.splice(0, 1000000); var flag = $("#All_Check").attr("checked"); $(".orderCheck").each(function () { if (typeof (flag) == 'undefined') flag = false; //$(":input[type=checkbox]").attr(&q…
function checkReturn(obj) { var objIds = obj.value; //当没有选中某个子复选框时,checkboxall取消选中 if (!$("#subcheck").checked) { $("#checkboxall").attr("checked", false); } // 获取subcheck的个数 var chsub = $("input[type='checkbox'][id='sub…
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <ti…
设置一个全选选框和四个子选框,要实现点击全选后四个子选框选中,取消全选后四个子选框也取消.全选后点击某个子选框,全选也能取消.当四个子选框都选中时,全选框也被选择. 实现代码: <script> var a=document.getElementById("a"); var b=document.getElementsByClassName("b"); //全选与取消全选 var y=true; a.onchange=function(){ if(a.c…
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <ti…