1.JPG (6.41 KB, 下载次数: 55)
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Check or Uncheck All</title> <SCRIPT LANGUAGE="JavaScript"> function setAllCheckValue(groupName) { var items=document.getElementsByName(groupName); for (var i=0;i<items.length;i++) { items[i].checked=!items[i].checked; } } </script> </head> <body> <form name=checkboxform> <br> <input type="checkbox" name="BasicInfo" id="setAllItems" onclick="setAllCheckValue('BasicInfo');this.checked=!this.checked;msg.innerHTML=this.checked?'全部不选中':'全部选中'" checked><span id="msg">全部不选中</span><br> <input type="checkbox" name="BasicInfo" id="C1" checked>C1<br> <input type="checkbox" name="BasicInfo" id="C2" checked>C2<br> <input type="checkbox" name="BasicInfo" id="C3" checked>C3<br> <input type="checkbox" name="BasicInfo" id="C4" checked>C4<br> <input type="checkbox" name="BasicInfo" id="C5" checked>C5<br> <input type="checkbox" name="BasicInfo" id="C6" checked>C6<br> <input type="checkbox" name="BasicInfo" id="C7" checked>C7<br> <input type="checkbox" name="BasicInfo" id="C8" checked>C8<br> <input type="checkbox" name="BasicInfo" id="C9" checked>C9<br> </form> </body> </html> |
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |