<input type="checkbox" name="che" id="che1">
<input type="checkbox" name="che" id="che2">
<input type="checkbox" name="che" id="che3">
<input type="checkbox" name="che" id="che4">
<input type="checkbox" name="che" id="che5">function check(){
var obj =document.getElementsByName('che');
for(i=0;i<obj.length;i++){
   if(obj[i].checked)
   {
   } }
}

解决方案 »

  1.   

    楼上的正解
    如果选项过于多的话<input   type= "checkbox "   name= "che "   id= "che1 ">
    <input   type= "checkbox "   name= "che "   id= "che2 ">
    <input   type= "checkbox "   name= "che "   id= "che3 ">
    <input   type= "checkbox "   name= "che "   id= "che4 ">
    <input   type= "checkbox "   name= "che "   id= "che5 ">function   check(){
    var   obj   =document.getElementsByName( 'che ');
    var   objLength = obj.length;;
    for(i=0;i <objLength ;i++){
          if(obj[i].checked)
          {
          }  }
    }