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