我开始是通过

$("input[name=xxx]").attr('checked',true); 

来设置是否选中的,各种不好用,明明页面的代码已经是checked=checked了,就是不显示勾选。

百思不得其解。。。

后来在网上找到了答案

if(dataBack.remind){
    $("#isremind").prop("checked",true);
}else{
    $("#isremind").removeAttr("checked");
}

 

添加的时候用prop,取消用removeAttr。

问题解决了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
猜你喜欢
  • 2022-02-04
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
相关资源
相似解决方案