1. 程式人生 > >jsp頁面應用簡記

jsp頁面應用簡記

1、記錄總資料條數

  <div class="" >

    <span class="">共有資料:<strong>${fn:length(list)</strong>條</span>

  </div>

2、是否的獲取與回顯

  <table class="table-hover" cellspacing="0" cellpadding="0" style="width:80%;margin-left: 10%;">
    <tr>
      <td colspan="3" style="width:75%;">

         承包商資質是否符合要求

      </td>
      <td id="pj1">
        <div class="radio-box">
          <input type="radio" name="pj1" id="pj1_s" checked = "checked" value="1"><label for="pj1_s">是</label>
        </div>
        <div class="radio-box">
          <input type="radio" name="pj1" id="pj1_f" value="0"><label for="pj1_f">否</label>
        </div>
      </td>
    </tr>
  </table>

  獲取: "pj1" : $("input[name='pj1']:checked").val(),

  回顯:$("input[name='pj1'][value='${con.pj1}']").attr("checked","checked");

  JS: $(":radio[name='rbsex'][value='" + sex + "']").prop("checked", "checked");    prop可能適應大多數IE版本

  可參考文章:https://blog.csdn.net/wyljz/article/details/52414310