html页面:
<c:if test="${courseStandardVos != null }"> <c:set var="index" value="0"/> <c:forEach items="${courseStandardVos }" var="courseStandardVo"> <tr> <td width="10%" align="center" valign="middle">${courseStandardVo.firstName}</td> <td width="10%" class="border_l" align="center" valign="middle">${courseStandardVo.secondName}</td> <td width="60%" align="left" valign="middle">${courseStandardVo.thirdName}</td> <c:set var="index" value="${index+1}"/> <td width="20%" align="center" valign="middle" name="grade" id="grade"> <input type="radio" id="score_five1" class="radio_ipt" name="radio${index}" value="5"/><label for="score_five1">5</label> <input type="radio" id="score_five2" class="radio_ipt" name="radio${index}" value="4"/><label for="score_five2">4</label> <input type="radio" id="score_five3" class="radio_ipt" name="radio${index}" value="3"/><label for="score_five3">3</label> <input type="radio" id="score_five4" class="radio_ipt" name="radio${index}" value="2"/><label for="score_five4">2</label> <input type="radio" id="score_five5" class="radio_ipt" name="radio${index}" value="1"/><label for="score_five5">1</label> </td> </tr> </c:forEach> </c:if>
jquery代码:
$("#submitGrade").click(function () {
$("#courseStandardVoId tr td").find("input[type='radio']").each(function(){
if($(this).is(":checked")){
alert($(this).val());
}
});
}
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步