网上找了很多资料,都是比较旧版本的方法,新版的jquery都已经抛弃了。

正确的代码是

$('input:radio[name="statusRadios"][value="normal"]').prop('checked', true);
$('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();

  

 

 

相关文章:

  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-11-28
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2021-11-13
  • 2021-11-23
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案