I can’t check checkboxes on second attempt(i can check then uncheck, but after this no effect)
See http://jsfiddle.net/SM5qU/1/
Attributes set to checked=”checked” but no visual effect.
I am using MacOS and tested in Chrome and Firefox
HTML
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<button id="check">Check</button>
<button id="uncheck">Uncheck</button>
JS
$('#check').click(function() {
$(':checkbox').attr('checked', true)
})
$('#uncheck').click(function() {
$(':checkbox').attr('checked', false)
})
use
.prop()in your case: