正反选
<script type="text/javascript">
function checkAll() {
var inputs = document.forms[0].elements;
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == ‘checkbox‘) {
if (inputs[i].disabled != true) {
if (inputs[i].checked == true) {
inputs[i].checked = false;
}
else {
inputs[i].checked = true;
}
}
else {
inputs[i].checked = false;
}
}
}
}
</script>
时间: 2024-11-01 13:20:30