Skip to content

Instantly share code, notes, and snippets.

@toshimaru
Created July 16, 2012 03:13
Show Gist options
  • Save toshimaru/3120211 to your computer and use it in GitHub Desktop.
Save toshimaru/3120211 to your computer and use it in GitHub Desktop.
handle <a> click event with jQuery.
// via: http://docs.jquery.com/How_jQuery_Works
$(document).ready(function(){
$("a").click(function(event){
alert("As you can see, the link no longer took you to jquery.com");
event.preventDefault();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment