<asp:RadioButtonList ID="rbl" runat="server" onMouseUp="Myf()">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>
function Myf() {
var list = document.getElementById("<%=rbl.ClientID %>");
var inputs = list.getElementsByTagName("input");
var selected;
for (var i = 0; i < inputs.length; i++) {
alert(inputs[i].innerHTML);
}
}
我得到了 Radiobuttonlist 的值。如何获取单选按钮列表的文本?