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