Skip to content

Instantly share code, notes, and snippets.

@UltCombo
Created April 10, 2013 23:07
Show Gist options
  • Save UltCombo/5359238 to your computer and use it in GitHub Desktop.
Save UltCombo/5359238 to your computer and use it in GitHub Desktop.
$('input')[0].checked ^= 1; //referência à prop checked do elemento input
inputElRef.checked = false ^ 1; //conversão implícita ToNumber
inputElRef.checked = 0 ^ 1; //bits diferentes, XOR retorna 1
inputElRef.checked = 1; //conversão implícita ToBoolean
inputElRef.checked = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment