Reputation: 261
In jQuery 1.9 v checkbox is not checked, once I have unchecked it, trying to check again by clicking on button
$("#add_cart_checkbox").attr("checked",'checked') ;
Upvotes: 25
Views: 12083
Reputation: 28528
working fine On This JsFiddle
$("#add_cart_checkbox").attr("checked",'checked') ;
It must be a problem of event bubbling which causes to call click event twice.
Upvotes: 1
Reputation: 219920
You have to use prop
, and pass it a boolean:
$("#add_cart_checkbox").prop("checked", true) ;
Upvotes: 57