Cancelling event propagation
Within an event handler, there are multiple methods to cancel event propagation, each with different semantics.
Only prevents the default browser behavior for the click, i.e. going to a different url or submitting a form.
Prevents the event from bubbling up the DOM. Note this effectively also cancels any event handlers attached through jQuery's
livemethod, since those depend on bubbling.
Prevents the event from triggering any remaining event handlers on the same DOM node.
Additionally, it also prevents the event from bubbling up the DOM, so you don't also need to call
falsein the event handler
This only exists for jQuery event handlers, but not for native listeners registered with
The same as
stopPropagation. Will not prevent event handlers bound on the element itself.