Skip to content

Instantly share code, notes, and snippets.

@RedWolves
Forked from elijahmanor/gist:590041
Created September 21, 2010 18:13
Show Gist options
  • Save RedWolves/590182 to your computer and use it in GitHub Desktop.
Save RedWolves/590182 to your computer and use it in GitHub Desktop.
// Did you mean return false?
// 'return false' stops the default behavior of the event
// and prevents it from bubbling up DOM, which kills
// event delegation and may not be what you indented.
// Learn how these event methods can fine tune your
// event handler functions.
$("#clickme").click(function(e) {
//Prevent the default click action from firing.
e.preventDefault();
//Prevent the event to propagate up the DOM tree
e.stopPropagation();
//Kill all default behavior and event propagation. (not recommended)
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment