全选 checkbox 复选框
时间:2015/11/30 11:27:00来源:互联网 作者:flyso 点击: 898 次
<script> var checkflag="false"; function check(field){ if(checkflag=="false"){ for(i=0;i<field.length;i++){ field[i].checked=true;} checkflag="true"; return "解除全选"; } else { for(i=0;i<field.length;i++) { field[i].checked=false;} checkflag="false"; return "选择全部";}} </script> <form name=myform action="" method=post> <b>软件系数调查:<br> </b><br> <input type=checkbox name=list >1<br> <input type=checkbox name=list>2<br> <input type=checkbox name=list >3<br> <input type=checkbox name=list >4<br> <input type=checkbox name=list >5<br> <input type=checkbox name=list >6<br> <br> <input type=button value=" 选择全部 " onClick="this.value=check(this.form.list)"> </form> |