//if(<%=rows["sex"]%>=="2"){$(':radio[name=sex]').eq(1).attr('checked',true);}
//设计value=2的为选中状态
//if(<%=rows["sex"].ToString() %>=='2'){$("input[name='sex']").attr("checked",'2');}
if(<%=rows["sex"]%>=="2"){$("input[name=sex][value=2]").attr("checked",true);}
今天办了件NB的事上面这三个条件都测试了不起作用,原因是不是本地数据库一直在远程数据库操作
JQuery 得到radio
代码如下:
1
2
3
4
5
// function Button1_onclick() {
$("input").each(function () {
if (this.type == 'radio') {
alert($(this).val());
}
});
}
function Button2_onclick() {
//alert($("input[@type=radio]:checked").val());
//alert($("input[name='rad']:checked").val());
alert($("input[@type=radio]").val());
}
// ]]>
script>
Copyright © 2019- fengyunshixun.com.cn 版权所有
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务