Home  >  Article  >  Web Front-end  >  Radio checked problem in jquery_jquery

Radio checked problem in jquery_jquery

WBOY
WBOYOriginal
2016-05-16 16:09:18930browse

Today was so crazy that I searched for this difficult question all afternoon. In the end, a friend from csdn gave me the correct answer. Thank you to this friend

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

Thanks also to another netizen for telling me

If you are using jquery1.9 or later, attr should not work. You need to use $(this).prop("checked", true);$(this).removeAttr("checked"); to select and remove the selection.

Thank you also to him

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn