function selectAll(myself) { var oState = myself.checked; var checkboxes = document.getElementsByName("chkIDCardNum"); //获取input组 for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i].disabled) { } else { checkboxes[i].checked = oState; //选择值 } } }