jQuery單選框的回顯


代碼示例:

html:

1 <div class="col-lg-4">
2    <label class="radio-inline">
3         <input type="radio" name="gender" value="1" id="s1">4    </label>
5    <label class="radio-inline">
6         <input type="radio" name="gender" value="0" id="s2">7    </label>
8  </div>

jquery:

1 //性別單選按鈕回顯
2 if ($("#stu_table").datagrid("getSelected").gender == 1) {
3    $("#s1").attr("checked",true);
4 }else {
5    $("#s2").attr("checked",true);
6 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM