我想为一个人创建一个星级评分系统,因为这个用户输入了五个不同类别的值,我想在一组单选按钮上显示这些值的平均值。我已经获得了平均值,但现在不知道如何显示平均值。
$("input[name='overall']").each(function(){
if(this.value == response.average){
$(this).attr('checked', true);
}
});
我想显示该字段的平均值----
<div id="overall_rating" class="Clear">
<input id="overall" name="overall" type="radio" class="star {split:5} required" disabled="disbled" value="0.2" />
<input id="overall" name="overall" type="radio" class="star" value="0.4"/>
<input id="overall" name="overall" type="radio" class="star" value="0.6"/>
<input id="overall" name="overall" type="radio" class="star" value="0.8"/>
<input id="overall" name="overall" type="radio" class="star" value="1.0"/>
<input id="overall" name="overall" type="radio" class="star" value="1.2"/>
<input id="overall" name="overall" type="radio" class="star" value="1.4"/>
<input id="overall" name="overall" type="radio" class="star" value="1.6"/>
<input id="overall" name="overall" type="radio" class="star" value="1.8"/>
<input id="overall" name="overall" type="radio" class="star" value="2.0"/>
<input id="overall" name="overall" type="radio" class="star" value="2.2"/>
<input id="overall" name="overall" type="radio" class="star" value="2.4"/>
<input id="overall" name="overall" type="radio" class="star" value="2.6"/>
<input id="overall" name="overall" type="radio" class="star" value="2.8"/>
<input id="overall" name="overall" type="radio" class="star" value="3.0"/>
<input id="overall" name="overall" type="radio" class="star" value="3.2"/>
<input id="overall" name="overall" type="radio" class="star" value="3.4"/>
<input id="overall" name="overall" type="radio" class="star" value="3.6"/>
<input id="overall" name="overall" type="radio" class="star" value="3.8"/>
<input id="overall" name="overall" type="radio" class="star" value="4.0"/>
<input id="overall" name="overall" type="radio" class="star" value="4.2"/>
<input id="overall" name="overall" type="radio" class="star" value="4.4"/>
<input id="overall" name="overall" type="radio" class="star" value="4.6"/>
<input id="overall" name="overall" type="radio" class="star" value="4.8"/>
<input id="overall" name="overall" type="radio" class="star" value="5.0"/>
</div>
请帮我找到解决这个问题的方法。