I’m using jQuery to check/uncheck all checkboxes in a div, and it works fine, but the master checkbox doesn’t seem to get clicked (i.e. I can’t see the check mark go on and off), how can I fix this?
This is the code I have so far:
jQuery(function () {
jQuery('#select_all').toggle(
function() {
jQuery('#elementos .c_e').prop('checked', true);
},
function() {
jQuery('#elementos .c_e').prop('checked', false);
}
);});
Thanks.
Here’s a live version: http://jsfiddle.net/L8DVu/
You you are making to complex, you can do it with single statement,
Live Demo