<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == false) box.checked = true;
}
}
function uncheckAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == true) box.checked = false;
}
}
function switchAll() {
for (var j = 1; j <= 9; j++) {
box = eval("document.checkboxform.C" + j);
box.checked = !box.checked;
}
}
// End -->
</script>
</head>
<body>
<form name=checkboxform>
<input type=checkbox name=C1>C1<br>
<input type=checkbox name=C2>C2<br>
<input type=checkbox name=C3>C3<br>
<input type=checkbox name=C4>C4<br>
<input type=checkbox name=C5>C5<br>
<input type=checkbox name=C6>C6<br>
<input type=checkbox name=C7>C7<br>
<input type=checkbox name=C8>C8<br>
<input type=checkbox name=C9>C9<br>
<br>
<input type=button value="全选" onClick="checkAll()"><br>
<input type=button value="取消" onClick="uncheckAll()"><br>
<input type=button value="反选" onClick="switchAll()"><br>
</form>
CSS群中单选引发的“事件”(2)
内容版权声明:除非注明,否则皆为本站原创文章。