javascript – 使用jquery清除radiobutton列表选择

我想在用户在TextBox中输入文本后清除Radiobutton列表选择.我尝试了以下代码,但它似乎没有工作,它没有显示任何错误.如果有任何建议,请告诉我.
function ClearRadioButtonList() {
    var checkBoxlistid9 = "#<%= rblLst.ClientID %>";
    $('.checkBoxlistid9').attr('checked',false);     
}

<telerik:RadMaskedTextBox ID="txtCode" runat="server" Mask="###-##-####" SelectionOnFocus="CaretToBeginning">
    <ClientEvents  OnBlur="ClearRadioButtonList" />
</telerik:RadMaskedTextBox>

<asp:RadioButtonList ID="rblLst" runat="server" RepeatDirection="Horizontal">
    <asp:ListItem Value="1">UnkNown</asp:ListItem>
    <asp:ListItem Value="2">Not Applicable</asp:ListItem>
</asp:RadioButtonList>

解决方法

代替:
$('.checkBoxlistid9').attr('checked',false);

尝试:

$('.checkBoxlistid9').removeAttr('checked');

另外我认为你的jQuery选择器是错误

$('.checkBoxlistid9')

我没有在你的asp:RadioButtonList上看到一个类checkBoxlistid9

查询选择器更改为:

$("table[id$=rblLst] input:radio:checked").removeAttr("checked");

要么

$("table[id$=rblLst] input:radio").each(function (i,x){
    if($(x).is(":checked")){
        $(x).removeAttr("checked");
    }
});

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...