This jquery code loops through all checkboxes in the dom and sets their checked attribute to the opposite of what it currently is.
$('input[type=checkbox]').each(function(){ $(this).attr("checked",!$(this).attr("checked")); })