Skip to content

Instantly share code, notes, and snippets.

@DonSchado
Created November 19, 2011 17:39
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 DonSchado/1379109 to your computer and use it in GitHub Desktop.
Save DonSchado/1379109 to your computer and use it in GitHub Desktop.
When a button is clicked, the selected class is removed from all other buttons and will be added it to the one clicked.
$('div.button a.available').click(function(e){
e.preventDefault();
$('a').removeClass('selected');
$(this).addClass('selected');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment