function checkVote(){ var input = document.voteResultForm.voteItemId ; var tag = false; for(var i = 0; i < input.length; i += 1){ if(input.checked){ tag = true; break; } } if(typeof(input.length) == "undefined"){ if(input.checked){ tag = true; } } if(tag){ document.voteResultForm.submit(); } else{ alert("请至少选择一项!"); return; } }