不要定义ID相同,没用,还会出错
可以定义name相同的。直接定义同名的checkbox就行了,用访问数组的方式访问<input name="chk1" type="checkbox" />
<input name="chk1" type="checkbox" />
<input name="chk1" type="checkbox" />
<input name="chk1" type="checkbox" />
<input name="chk1" type="checkbox" />
<input name="chk1" type="checkbox" />for (var i=0;i<chk1.length;i++)
  alert(chk1[i].checked);以循环的方式来访问每一个对象