Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Created March 28, 2013 21:21
Show Gist options
  • Save jlittlejohn/5266916 to your computer and use it in GitHub Desktop.
Save jlittlejohn/5266916 to your computer and use it in GitHub Desktop.
JS: Conditional Event Handling
// Conditional Event Handling
$('#target').click(function(e) {
if ( $(e.target).is('a') ) {
// code
// e.preventDefault();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment