Reputation: 7342
I have some code that is broken in the latest version of chrome (32.0.1700.107). jQuery version is 1.10.1. This code has been running in other browsers for the last year. It does work correctly in IE8. The key section of code is below -
var stateWideCb = $('.showStatewide input');
stateWideCb.change(function () {
var b = $(this).is(':checked');
$('.showRegion input').attr('checked', b);
});
What happens is that after the first two clicks on the the Master checkbox, the code stops working.
You can see it at http://jsfiddle.net/photo_tom/dXczB/1/
Upvotes: 1
Views: 1107
Reputation: 207861
Change:
.attr('checked', b);
to
.prop('checked', b);
As the jQuery docs on .attr()
state:
To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.
Upvotes: 4