This example summarizes the method for the jquery Action checkbox checkbox. Share to everyone for your reference. The specific analysis is as follows:
jquery checked three ways to determine:
Copy Code code as follows:
$ ("input"). attr ("checked"); Version 1.6+ return: "Checked" or "undefined", 1.5-return: TRUE or False
$ ("input"). Prop ("checked"); 16+:true/false
$ ("input"). Is (": checked"); All versions: True/false
Several ways to checked jquery assignment:
All jquery versions can be assigned this way:
Copy Code code as follows:
$ ("input"). attr ("Checked", "checked");
$ ("input"). attr ("Checked", true);
jquery1.6+:p 4 kinds of assignment of ROP:
Copy Code code as follows:
$ ("input"). Prop ("checked", true);
$ ("input"). Prop ({checked:true}); Map Key value pairs
$ ("input"). Prop ("Checked", function () {
Return true;//function returns TRUE or FALSE
});
$ ("input"). Prop ("Checked", "checked");
I hope this article will help you with your jquery programming.