Home > Web Front-end > JS Tutorial > body text

Radio checked problem in jquery_jquery

WBOY
Release: 2016-05-16 16:09:18
Original
976 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template