event.stopPropagation() prevents the event from bubbling up the DOM tree, so parent handlers are not notified. Takes no arguments, returns undefined. Since jQuery 1.0. Other handlers on the same element still run. Check with isPropagationStopped(). Also works with custom events from .trigger().
Syntax
Start with these common calls. Keep them short and readable.
jQuery
event.stopPropagation() // no args
$("p").on("click", function (event) {
event.stopPropagation(); // parents will not hear this click
});
// Same-element handlers: still run
// To also skip them → stopImmediatePropagation()
Call
What it does
event.stopPropagation()
Learn jQuery event.stopPropagation(): stop event bubbling to parents while same-element handlers still run, official nested click demo, vs stopImmediatePropagation, card patterns, examples, pitfalls, and FAQs.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Bind a handler on the inner element (button, link, paragraph, …).
Step 2
Inside that handler, call event.stopPropagation().
Step 3
Parent handlers will not run for this event.
Return Value
Return Value
Description
Boolean
Often true or false depending on the match or state.
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery Examples
Example 1 — Nested Click: Stop the Parent
Inner element stops bubbling so the parent click handler never runs.
jQuery
$("#parent").on("click", function () {
$("#out").append("parent handler ran\n");
});
$("#child").on("click", function (event) {
event.stopPropagation();
$("#out").append("child ran — propagation stopped\n");
});
A1 (stopPropagation)
A2 still ran
B1 (stopImmediate)
How It Works
Button A.stopPropagation — A2 still runs.
Button B.stopImmediatePropagation — B2 is skipped.
Both. Stop ancestor bubbling.
Frequently Asked Questions
event.stopPropagation() prevents the event from bubbling up the DOM tree so parent handlers are not notified. It takes no arguments, returns undefined, and has been available since jQuery 1.0. Other handlers on the same element still run.
Call it when a child handler must run without triggering parent handlers — for example, a button inside a clickable card, or an inner control that should not activate an outer row click.
stopPropagation() stops bubbling to parents but other handlers on the same element still run. stopImmediatePropagation() stops both bubbling and any remaining handlers on the same element.
Yes. In jQuery handlers, return false calls preventDefault() and stopPropagation(). It does not call stopImmediatePropagation(), so remaining same-element handlers may still run.
Use event.isPropagationStopped(). It returns true if stopPropagation() was called on this event object during the current dispatch. Available since jQuery 1.3.
No. It affects bubbling only. To cancel link navigation or form submit, call event.preventDefault() separately.