function countNum(){ //alert($('input[name=check]:checked').length); var arrays = new Array(); var items = document.getElementsByName("check"); for(var i=0;i<items.length;i++){ if(items[i].checked){ arrays.push(items[i].value); } } alert(arrays.length); }