方法1:摘自网络
View Code
<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" />
方法2:原创
View Code
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" />