-
Notifications
You must be signed in to change notification settings - Fork 480
It is odd when using "attr" on checkbox, it works on the first time only #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@LeonLi0102 Please can you provide a test case? Everything works fine here http://jsfiddle.net/129d9ubc/1/ |
Please read the documentation about boolean attributes on http://api.jquery.com/attr/. |
<textarea> <title>Checkbox Test</title> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script> $().ready(function(){ $("#checkControl").click(function(){ // It is odd it works only on the first time whey you click 'All/None' $("input[name='check_items']").attr("checked",this.checked); // I know this will work, but still the code above is confused me. // $("input[name='check_items']").prop("checked",this.checked); }); }); </script> All/None |
@LeonLi0102 Please read the documentation pointed by @scottgonzalez and you'll understand |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: