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().
Remember
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 it on a child when parents must not handle the same event.
Bind a handler on the inner element (button, link, paragraph, …).
Inside that handler, call event.stopPropagation().
Parent handlers will not run for this event.
Other handlers on the same element still run in bind order.
Optionally check later with event.isPropagationStopped().
Piece
Required?
Role
event argument
Yes
jQuery event object
stopPropagation()
Yes (to stop bubble)
Blocks parent notification
Parent handler
Optional
Will not run if bubbling stopped
preventDefault()
Optional
Separate — cancels browser default
Pseudocode
Pseudocode
child.on("click", handlerChild)
parent.on("click", handlerParent)
when click on child:
run handlerChild
if handlerChild calls stopPropagation():
do not notify parent
else:
bubble → run handlerParent
// Other handlers on child still run
// (unless stopImmediatePropagation)
Reference
Cheat Sheet
Keep these facts handy while controlling bubbling.
Topic
Detail
Syntax
event.stopPropagation()
Arguments
None
Returns
undefined
Since
jQuery 1.0
Parents
Not notified
Same-element handlers
Still run
Custom events
Works with .trigger()
vs immediate
Immediate also skips same-element queue
Try it
Live Preview
Click the inner button — parent does not run. Click the outer area — parent runs. Same idea as the official nested-click pattern from the jQuery API.
Links and forms still do their normal action unless you also call preventDefault().
false
return false includes stopPropagation
In jQuery, return false = preventDefault + stopPropagation. Prefer explicit calls when you only need one.
live
Legacy live/delegate caveat
Handlers that only run after the event reaches a higher node may have already run lower ones. Prefer .on().
Compatibility
Browser Support
event.stopPropagation() has been available since jQuery 1.0. Stopping bubble is a standard DOM capability; jQuery exposes it on the event object. Works wherever your loaded jQuery version runs.
✓ Stable · jQuery 1.0+
event.stopPropagation()
Supported wherever jQuery 1.0+ is loaded. Prefer jQuery 3.x with .on() for modern nested UI handlers.
100%jQuery support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
stopPropagation()1.0+
Bottom line: Safe for production. Use it to isolate child clicks from parent handlers; pair with isPropagationStopped() and preventDefault() as needed.
Analysis
Performance Notes
Approach
Cost
Best for
stopPropagation()
Negligible
Isolating child interactions
Deep nested click trees
Fine
Stop early on the child that owns the action
Document-level listeners
Skipped if stopped
Useful when you want to avoid global handlers
Over-stopping
Surprising UX
Only stop when a parent must not react
The call itself is free. The win is skipping parent work — especially expensive document or container handlers.
Remember
Key Takeaways
Role: stop the event from bubbling to parents.
Same element: other handlers on this element still run.
One line:stopPropagation() means “parents, ignore this event.”
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.