开发者社区 问答 正文

js或jQuery设置单选框(性别选择)

使用jQuery设置单选框(性别)的checked属性为true不能成功,但是js却可以,这是jQuery的bug吗?

展开
收起
小旋风柴进 2016-03-20 11:22:27 3647 分享 版权
1 条回答
写回答
取消 提交回答
  • jquery这里有bug,要同时使用

    $(this).prop("checked",true);
    $(this).attr("checked",true);

    才可以

    2019-07-17 19:09:13
    赞同 展开评论