zoukankan      html  css  js  c++  java
  • jquery遍历的radio的取值问题

    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());
    }
    });



  • 相关阅读:
    Rraspberry Pi 4B python3 安装opencv
    如何用arduion制作智能 垃圾桶
    MySQL(二)表结构的管理
    MySQL(一)基础操作
    vc++绘图基础
    网站签~
    (转)Oracle 知识日常积累
    利用反射判断bean属性不为空(null和空串)
    (转)Oracle 单字段拆分成多行
    svn 解决树冲突
  • 原文地址:https://www.cnblogs.com/Eddyer/p/5733474.html
Copyright © 2011-2022 走看看