【发布时间】:2011-01-23 05:12:33
【问题描述】:
这是 jquery 代码,它隐藏了我的 ID 为 .style2 的表格单元格:
$('#myRadioButtonList').change(function() {
if ($(this).attr('checked') == true && $(this).val() == "HB") {
$('.style2').hide("slow");
};
});
这是我的单选按钮列表
<asp:RadioButtonList ID="myRadioButtonList" runat="server">
<asp:ListItem Selected="True" Value="HB">None</asp:ListItem>
<asp:ListItem Value="HOBSKS">Service </asp:ListItem>
<asp:ListItem Value="OBAKS">Open Service</asp:ListItem>
<asp:ListItem Value="BBKS">Close Service</asp:ListItem>
</asp:RadioButtonList>
我受到这个话题的启发
Using JQuery with RadioButtons to hide/show table rows
这样我的jquery就不行了,部分有错误
if ($(this).attr('checked') == true && $(this).val() == "HB")
我单独尝试了上面的这两个条件,但它们都不起作用。我需要使用我的单选按钮,但似乎我做不到。那我应该如何写那部分才能使我的代码工作。
谢谢。
【问题讨论】:
标签: asp.net jquery radio-button radiobuttonlist