当前位置:Gxlcms > JavaScript > jquery中radiochecked问题_jquery

jquery中radiochecked问题_jquery

时间:2021-07-01 10:21:17 帮助过:11人阅读

今天太鬼火了为这个难问题搜了一下午了到最后还是csdn的朋友给了我正确的答案,谢谢这位朋友

// $("#ISOK1").checked = "checked";
// $("#ISOK1").attr("checked", true);
//$("#Radio1").attr("checked", true);
// $("#Radio1").checked = "checked";
$("#ISOK1")[0].checked = true;

另外感谢另外一位网友告诉我

如果是用jquery1.9以后版本,attr应该不管用了,要用$(this).prop("checked", true);$(this).removeAttr("checked");选中和去除选中

同样感谢他

人气教程排行