您的位置:首页 > Web前端 > JQuery

使用jquery 获取RadioButtonList 中选中值

2014-02-15 08:38 344 查看
第一种方法:

<mce:script language="javascript"><!--

$(document).ready(function() {

$("#btnSubmit").click(function() {

alert($("#RadioButtonList1").find("input[@checked]").val());

});

});

// --></mce:script>

<asp:RadioButtonList ID="RadioButtonList1" runat="server">

<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>

<asp:ListItem>3</asp:ListItem>

</asp:RadioButtonList>

<input id="btnSubmit" type="button" value="Submit" />

第二种方法:

var rubricType = $("input[name='rblRubricType']:checked").val();

<mce:script language="javascript"><!--

$(document).ready(function() {

$("#btnSubmit").click(function() {

alert($("input[name='RadioButtonList1']:checked").val());

});

});

// --></mce:script>

<asp:RadioButtonList ID="RadioButtonList1" runat="server">

<asp:ListItem>1</asp:ListItem>

<asp:ListItem>2</asp:ListItem>

<asp:ListItem>3</asp:ListItem>

</asp:RadioButtonList>

<input id="btnSubmit" type="button" value="Submit" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: