Skip to content

Instantly share code, notes, and snippets.

@cschlyter
Created March 22, 2013 13:45
Show Gist options
  • Save cschlyter/5221386 to your computer and use it in GitHub Desktop.
Save cschlyter/5221386 to your computer and use it in GitHub Desktop.
[javascript] toggle checkbox on/off
checkbox.attr("checked", !checkbox.attr("checked"));
@Tymek
Copy link

Tymek commented Apr 29, 2017

Misleading title. It's Javascript with JQuery. Vanilla JS: checkbox.checked = !checkbox.checked;

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