Pregunta

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

¿Fue útil?

Solución

Use .prop():

$('.cbx').prop('checked', false);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top