正确的代码是
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();
转自:雾里寻踪