public
Last active

Uncheck checkboxes using jQuery

  • Download Gist
jq-clear-checkboxes.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
* jQuery - Uncheck Checkboxes - 05/17/2011
* http://corydorning.com
*
* Dual licensed under 'Use it like you stole it'
* and 'I Don't Care'.
*
* Description: Uncheck any checkeboxes that might
* be checked. Simple, yet effective, particularly
* for how I needed to use it with AJAX.
*
* Example usage:
* clearCheckboxes($(':checkbox'));
*
*/
 
function clearCheckboxes($sel) {
$sel.each(function() {
this.checked = false;
});
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.