Skip to content

Instantly share code, notes, and snippets.

@fuddl
Last active December 17, 2015 15:39
Show Gist options
  • Save fuddl/5633560 to your computer and use it in GitHub Desktop.
Save fuddl/5633560 to your computer and use it in GitHub Desktop.
Uncheck all checkboxes with jQuery
jQuery(':radio').removeAttr('checked');
@yannickoo
Copy link

That won't work because forEach is only available for arrays. Talket with @Havvy and it ended up with:

Array.prototype.forEach.call(document.querySelectorAll('input[type="checkbox"]'),function(a){a.checked=false});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment