Skip to content

Instantly share code, notes, and snippets.

@segovia94
Last active August 29, 2015 14:01
Show Gist options
  • Save segovia94/50c8488c014423142aa3 to your computer and use it in GitHub Desktop.
Save segovia94/50c8488c014423142aa3 to your computer and use it in GitHub Desktop.
Toggle all checkboxes
//requires jQuery 1.6 minimum
var $checkBoxes = $('input:checkbox');
$checkBoxes.prop("checked", !$checkBoxes.prop("checked"));
//bookmarklet created via: http://benalman.com/code/test/jquery-run-code-bookmarklet/
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.6",function($,L){var%20$checkBoxes=$("input:checkbox");$checkBoxes.prop("checked",!$checkBoxes.prop("checked"));});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment