Skip to content

Instantly share code, notes, and snippets.

@amycheng
Created October 23, 2012 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amycheng/3940218 to your computer and use it in GitHub Desktop.
Save amycheng/3940218 to your computer and use it in GitHub Desktop.
cleanest jQuery I've ever writtern
$formField.click(function(){
var $_this= $(this);
$_this
.css('opacity','1')
.find('input').removeAttr('disabled');
$_this.siblings()
.css('opacity','.5')
.find('input').attr('disabled','disabled');
});
/*
I went from 20+ lines of code to this.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment