JQuery设置选中单选按钮在IE10中不工作

JQuery设置选中单选按钮在IE10中不工作,jquery,asp.net,radiobuttonlist,Jquery,Asp.net,Radiobuttonlist,该代码在Chrome中运行良好,但在IE中,它不会检查值为1的单选按钮 function RebalanceProspectDisabled(){ var x = $(".ProspectRebalanceType input:radio:checked").val(); if(x == 0){ $("input[name=ProspectRebalanceType][value=1]").attr("checked","checked"); $(

该代码在Chrome中运行良好,但在IE中,它不会检查值为1的单选按钮

function RebalanceProspectDisabled(){
    var x = $(".ProspectRebalanceType input:radio:checked").val();
    if(x == 0){
        $("input[name=ProspectRebalanceType][value=1]").attr("checked","checked");
        $("#modalMessageAlert").dialog("open");
        return false;
    }   
}

<asp:RadioButtonList ID="ProspectRebalanceType" CssClass="ProspectRebalanceType" runat="server" onClick="return RebalanceProspectDisabled();">
                    <asp:ListItem Text="Least Amount of Trades" Value="0"  />
                    <asp:ListItem Text="Full Rebalance" Value="1" Selected="True" />
                </asp:RadioButtonList>   
函数重新平衡已禁用(){
var x=$(“.ProspectRebalanceType输入:radio:checked”).val();
如果(x==0){
$(“输入[name=ProspectRebalanceType][value=1]”)attr(“选中”、“选中”);
$(“#modalMessageAlert”)。对话框(“打开”);
返回false;
}   
}

我总是希望选中值为“1”的单选按钮,当用户单击值为“0”的单选按钮时,我会显示我的对话框,但默认情况下会返回到选择值为“1”的单选按钮。

请尝试
$(“输入[name=ProspectRebalanceType][value=1])。prop(“选中”,true)使用
prop(“checked”,true)
而不是
attr(“checked”,“checked”)
在chrome和IEIE中看这项工作很好,我得到了“错误:对象不支持属性或方法“prop””,我在阅读其他帖子时尝试了这一点,但没有效果,这就是为什么我写了一篇新帖子,谢谢你的建议though@AlekseiBulgak我正在使用一个单选按钮列表,而不是一个复选框,我不想设置文本值,我想根据该值设置checked属性,但感谢您的建议