Jquery页面在radio 初始化时候默认选中

正确的代码是

1 $('input:radio[name="statusRadios"][value="normal"]').prop('checked', true);
2 $('input:radio[name=statusRadios]').filter('[value=banned]').prop('checked', true);  //这个也可以

如果还使用了jquery的uniform插件,那么还需要增加一句

 

$.uniform.update();

完整的就是

$('input:radio[name="statusRadios"][value="normal"]').prop('checked', true);
//$('input:radio[name=statusRadios]').filter('[value=banned]').prop('checked', true);  //这个也可以
$.uniform.update();

转自:雾里寻踪

posted @ 2016-05-12 16:33  wanwanwhl  阅读(2515)  评论(0编辑  收藏  举报