请帮忙看看怎样实现a的循环
问题:实现全选或半选<script>
function fncSelectAll(obj){
var (a=1;a.length-1;a++)
var objs=document.getElementsByName(obj.name+ [a]);
for(var i=0;i <objs.length;i++){
objs[i].checked=obj.checked;
}
}
</script>
<form method="post" id="form" name="form" action="n.asp">
<input type="checkbox" name="X1">
<input type="checkbox" name="X2">
<input type="checkbox" name="X3">
<input type="checkbox" name="X4">
<input type="checkbox" name="X5">
<input type="checkbox" name="X6">
<input type="checkbox" name="X7">
<input type="checkbox" name="X8">
<input type="checkbox" name="X9">
<input type="checkbox" name="X10">
<input type="checkbox" name="X11">
<input type="checkbox" name="X12">
<input type=checkbox name=X onclick="fncSelectAll(this)"> 全选
</form>