获取所有被选定的checkbox的值 var check_array = document.getElementsByName("itemId");for(var i=0;i<check_array.length;i++){ if(check_array[i].checked==true) { ss+=check_array[i].value+","; }}ss = ss.substr(0,ss.length-1);