jquery 操作radio選中無效的問題


1、試過多個方式,都無法改變

$('input:radio[name=status]').eq(0).checked =printInfo.status!=1
$('input:radio[name=status]').eq(0).attr('checked', 'true')
$('input:radio[name=status]').eq(0).prop('checked', 'true')
$('input:radio:first').attr('checked', 'checked');
$("input:radio[value=2]").attr('checked','true')
$($('#switch1').eq(0)).prop('checked',true);
$('#switch1').prop('checked',true);

先remove再prop
$("input[name='status']").eq(0).removeAttr("checked");
$("input[name='status']").eq(1).removeAttr("checked");
$("input[name='status']").eq(0).prop("checked","checked");

 

2、問題發現,是因為使用了uniform 美化插件

 
        

3、解決在后面加上  $.uniform.update();

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM