var radios = document.getElementsByName('score');
var num = radios.length;
var isCheck = false;
for(var j = 0; j < num; j++){
if(radios[j].checked){
isCheck = true;
}
}
if(!isCheck){
alert("评分不能为空!");
return false;
}
<div class="stars">
<label for="score_5">
<input type="radio" name="score" value="5" id="score_5" />
<span id="score5">(5分)</span></label>
<label for="score_4">
<input type="radio" name="score" value="4" id="score_4" />
<span id="score4">(4分)</span></label>
<label for="score_3">
<input type="radio" name="score" value="5" id="score_3" />
<span id="score3">(3分</span>)</label>
<label for="score_2">
<input type="radio" name="score" value="4" id="score_2" />
<span id="score2">(2分)</span></label>
<label for="score_1">
<input type="radio" name="score" value="5" id="score_1" />
<span id="score1">(1分)</span></label>
</div>