ridio checkbox IE6 IE7 跟IE8不兼容

///isdelete,power是传进来的参数

if(isdelete=='True')//$("input[@type=radio]").attr("checked",'10');
        $("input[name='addisdelete'][value='1']").attr("checked", true);
     else
        $("input[name='addisdelete'][value='0']").attr("checked", true);
     var str= new Array();  
     str=power.split(",");
     for (i=0;i<str.length ;i++ ){$("input[name='addpower'][value='"+str[i]+"']").attr("checked", true);}
     //兼容IE6
     var isIE=(!!window.ActiveXObject);
     var isIE6=(isIE&&!window.XMLHttpRequest);
     var isIE8=isIE&&!!document.documentMode;
     var isIE7=isIE&&!isIE6&&!isIE8;
     if (isIE&&(isIE6||isIE7)){if(isdelete=='True')
        $("input[name='addisdelete'][value='1']").attr("defaultChecked", true);
     else
        $("input[name='addisdelete'][value='0']").attr("defaultChecked", true);
     for (i=0;i<str.length ;i++ ){$("input[name='addpower'][value='"+str[i]+"']").attr("defaultChecked", true);}
     }

你可能感兴趣的:(checkbox)