This example describes the solution that the checkbox in jquery repeatedly calls attr (' checked ', true/false) only for the first time. Share to everyone for your reference, specific as follows:
First look at the following code:
/**
* All select
/function Checkall () {
$ ("input[name=ids]"). attr ("Checked", true);
}
/**
* Do not select
/
function Uncheckall () {
$ ("input[name=ids]"). attr ("checked", false);
}
Problem Description:
The initial state checkbox is not fully selected, click the Select button to call the Checkall method, the implementation of the full selection, and then click the Full selection button to achieve a full choice, and then click the Full Selection button again, the result is a full selection of wood, and then repeatedly click on the wood has any reaction.
Workaround:
Google's:
Instead of the attr method using the Prop method,
/**
* All select
/function Checkall () {
$ ("input[name=ids]"). Prop ("checked", true);
}
Solve the problem!
More interested readers of jquery-related content can view the site: "jquery form Operation Tips", "jquery switching effects and techniques summary", "jquery drag-and-drop effects and techniques summary", "JQuery Extended Skills Summary", " jquery Common Classic Effects Summary "jquery animation and special effects usage Summary", "jquery selector usage Summary" and "jquery common Plug-ins and Usage summary"
I hope this article will help you with the jquery program design.