Skip to content

Instantly share code, notes, and snippets.

@UltCombo
Last active December 16, 2015 00:49
Show Gist options
  • Save UltCombo/5350767 to your computer and use it in GitHub Desktop.
Save UltCombo/5350767 to your computer and use it in GitHub Desktop.
XOR checkbox checked state toggler
<input type="checkbox"><button>Clique para alternar estado do checkbox</button>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$('button').click(function() {
$('input')[0].checked ^= 1;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment