Question

I have this code [1] for check/uncheck several checkbox elements in a page. It works good on jQuery versions previous to 1.9.1 but for some reason it doesn't on 1.9.1 or newer

Basically, what I do is:

$('.cbx').attr('checked', false);

[1] http://jsfiddle.net/qNPCH/4/

Do you know how can I achieve this with newer versions of jQuery?

Thanks

Était-ce utile?

La solution

Use .prop():

$('.cbx').prop('checked', false);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top