asp.net中RadioButtonList服务器控件
<asp:RadioButtonList ID="rb_type" runat="server" RepeatDirection="Horizontal" CellPadding="10" CellSpacing="10" Width="100%">
<asp:ListItem Value="0" Selected="True">文字</asp:ListItem>
<asp:ListItem Value="1">图片</asp:ListItem>
</asp:RadioButtonList>
Jquery:
$("#<%=rb_type.ClientID%> input[type=radio]").change(function(){
if ($(this).val()!="") {
alert("Come here!"+$(this).val());
}
});
length有数据的,但是很奇怪怎么没触发到change事件
追答如果length有数据,你可以在change事件的第一行代码,alert(123)。应该会触发的。
会不会是你change事件中的代码,有错误?