When i check\uncheck checkboxes and radiobuttons, browser doesnt set attribute checked. So, when i am trying uncheck checkbox using jquery:
$('#tab2 input').removeAttr('checked');
it doesnt work. It works case checkbox was checked from my javascript code. How can i uncheck checkbox which already checked by user?
You’re setting a property, so use
.prop()injQuery 1.6.Or if there’s only one
input, just change the property of the element directly.WhenOr upgrade tojQuery 1.6.1is released,jQuery 1.6.1and you’ll be able to go back to using.attr()to set properties again, but.prop()will still be the better way to do it.From the release notes: