jQuery event.stopImmediatePropagation()

Beginner
⏱️ 9 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Event object · jQuery 1.3+

What You’ll Learn

event.stopImmediatePropagation() halts the handler queue on the current element and stops bubbling. This tutorial covers the official jQuery p/div demo, blocking analytics handlers, comparing with stopPropagation() and return false, and checking state with isImmediatePropagationStopped().

01

Method

stopImmediatePropagation()

02

Returns

undefined

03

Official

p vs div demo

04

Same element

Skip handlers

05

Bubbling

Implicit stopProp

06

Since 1.3

No arguments

Introduction

When multiple handlers are bound to the same element with .on(), jQuery runs them in registration order during one dispatch. Sometimes an early handler must stop the rest — not just parent bubbling, but every remaining listener on that element.

event.stopImmediatePropagation() does exactly that. jQuery has exposed this method since version 1.3 on its normalized event object. The official demo binds two handlers to p — the first calls stopImmediatePropagation(), so the second never runs — while a handler on sibling div still executes normally.

Understanding event.stopImmediatePropagation()

This method tells jQuery: stop running handlers on this element and do not bubble further.

  • Same element — remaining handlers registered on the current target are skipped.
  • Bubbling stopped — implicitly calls event.stopPropagation() so parent handlers do not run.
  • No arguments — call it with empty parentheses; returns undefined.
  • Check afterward — use event.isImmediatePropagationStopped() to verify the flag was set.
💡
Beginner Tip

Use stopImmediatePropagation() when you need to halt the handler queue on one element — not when you only want to block parent handlers. For bubbling alone, stopPropagation() is enough and lets other same-element handlers continue.

📝 Syntax

Official jQuery API form (since 1.3):

jQuery
event.stopImmediatePropagation()
// typical pattern:
$( "button" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
  // remaining handlers on this button are skipped
});

Parameters

  • None — this method does not accept any arguments.

Return value

  • undefined — the method stops handlers and bubbling as a side effect. Use event.isImmediatePropagationStopped() to check state afterward.

Official jQuery API example

jQuery
$( "p" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
});
$( "p" ).on( "click", function ( event ) {
  // This function won't be executed
  $( this ).css( "background-color", "#f00" );
});
$( "div" ).on( "click", function ( event ) {
  // This function will be executed
  $( this ).css( "background-color", "#f00" );
});

⚡ Quick Reference

GoalAPIEffect
Skip remaining handlers + stop bubbleevent.stopImmediatePropagation()Handler queue halted
Check if calledevent.isImmediatePropagationStopped()Returns Boolean
Stop bubbling onlyevent.stopPropagation()Same-element handlers may continue
jQuery shorthandreturn falseprevent + stopPropagation (not immediate)
Cancel default actionevent.preventDefault()Separate concern

📋 stopImmediatePropagation() vs stopPropagation() vs return false vs isImmediatePropagationStopped()

Four related tools — halt the handler queue, stop bubbling only, jQuery shorthand, or read the flag.

stopImmediatePropagation
event.stopImmediatePropagation()

Skip remaining handlers + stop bubbling

stopPropagation
event.stopPropagation()

Stop bubbling; same-element handlers continue

return false
return false

prevent + stopPropagation (not immediate)

isImmediatePropagationStopped
event.isImmediatePropagationStopped()

Read flag (Boolean)

Examples Gallery

Example 1 follows the official jQuery p/div demo. Examples 2–5 cover analytics blocking, stop method comparison, document-level bubbling, and plugin guard patterns.

📚 Official jQuery Demo

First p handler stops immediate; second p handler skipped; div handler runs.

Example 1 — Official Demo: log which handlers run

Official jQuery demo — first p handler calls stopImmediatePropagation(); second p handler is skipped; clicking div runs its handler.

jQuery
$( "p" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
  $( "#log" ).append( "<div>p handler 1 ran — immediate stopped</div>" );
});
$( "p" ).on( "click", function ( event ) {
  $( "#log" ).append( "<div>p handler 2 ran (skipped)</div>" );
});
$( "div" ).on( "click", function ( event ) {
  $( "#log" ).append( "<div>div handler ran</div>" );
  $( this ).css( "background-color", "#f00" );
});
Try It Yourself

How It Works

stopImmediatePropagation() affects only the handler queue on the element where it was called. Sibling elements like div are unaffected — their handlers run normally when clicked.

Example 2 — Primary handler blocks analytics on same button

Primary click handler calls stopImmediatePropagation() when the action is handled — analytics handler on the same button never fires.

jQuery
$( "#buy" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
  $( "#status" ).text( "Purchase handled by primary handler" );
});
$( "#buy" ).on( "click", function ( event ) {
  $( "#status" ).append( " | analytics tracked" );
});
Try It Yourself

How It Works

When a primary handler owns the click, stopping immediate propagation prevents secondary handlers — analytics, tooltips, or legacy plugins — from running on the same element.

📈 Practical Patterns

Compare stop methods, bubbling behavior, and plugin cooperation.

Example 3 — stopImmediatePropagation vs stopPropagation side-by-side

Two buttons demonstrate the difference — stopPropagation() lets a second handler run; stopImmediatePropagation() does not.

jQuery
// Button A — stopPropagation only
$( "#btn-a" ).on( "click", function ( event ) {
  event.stopPropagation();
  $( "#log-a" ).append( "Handler 1 (stopPropagation)\n" );
});
$( "#btn-a" ).on( "click", function () {
  $( "#log-a" ).append( "Handler 2 still ran\n" );
});
// Button B — stopImmediatePropagation
$( "#btn-b" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
  $( "#log-b" ).append( "Handler 1 (stopImmediate)\n" );
});
$( "#btn-b" ).on( "click", function () {
  $( "#log-b" ).append( "Handler 2 still ran\n" );
});
Try It Yourself

How It Works

stopPropagation() halts bubbling but not the same-element queue. stopImmediatePropagation() does both — use it when later handlers on that element must not run.

Example 4 — Inner handler stops immediate; document handler blocked

First handler on an inner span calls stopImmediatePropagation() — document-level click handler does not run because bubbling is also stopped.

jQuery
$( document ).on( "click", function () {
  $( "#log" ).append( "<div>document handler ran</div>" );
});
$( "#inner" ).on( "click", function ( event ) {
  event.stopImmediatePropagation();
  $( "#log" ).append( "<div>inner handler ran — bubbling stopped</div>" );
});
$( "#inner" ).on( "click", function () {
  $( "#log" ).append( "<div>inner handler 2 (skipped)</div>" );
});
Try It Yourself

How It Works

Because stopImmediatePropagation() implicitly calls stopPropagation(), the event never reaches document. Both the handler queue and the bubble chain halt at the inner element.

Example 5 — Plugin pattern: guard with isImmediatePropagationStopped

Validation plugin stops immediate propagation on failure; fallback plugin checks the flag before running.

jQuery
// Validation plugin — bound first
$( "#save" ).on( "click", function ( event ) {
  if ( !$( "#name" ).val() ) {
    event.stopImmediatePropagation();
    $( "#msg" ).text( "Validation failed" );
  }
});
// Fallback plugin — bound second, guards before running
$( "#save" ).on( "click", function ( event ) {
  if ( event.isImmediatePropagationStopped() ) return;
  $( "#msg" ).text( "Save handler ran — form would submit." );
});
Try It Yourself

How It Works

Cooperative plugins use stopImmediatePropagation() to halt the queue and isImmediatePropagationStopped() to detect when an earlier handler already stopped it.

🚀 Common Use Cases

  • Handler ownership — primary handler stops immediate propagation so legacy or analytics handlers on the same element do not run.
  • Validation gates — fail fast on invalid input and skip save or submit handlers bound later.
  • Plugin conflicts — one plugin stops the queue when it handles the event exclusively.
  • Exclusive UI modes — modal or overlay handler prevents other click listeners on the same trigger.
  • Event delegation edge cases — child handlers may stop immediate propagation before delegated parent logic on the same element runs.
  • Debugging handler order — pair with isImmediatePropagationStopped() to trace which handler halted the queue.

🧠 How stopImmediatePropagation() Works

1

Event fires

User clicks an element with multiple bound handlers — jQuery starts the handler queue in registration order.

Trigger
2

Early handler runs

First handler calls event.stopImmediatePropagation() when it must own the dispatch.

Handler
3

Queue halted + bubble stopped

Remaining same-element handlers are skipped. Bubbling stops via implicit stopPropagation().

Stop
4

Exclusive handling

Only handlers that ran before the stop execute. Use isImmediatePropagationStopped() to verify the flag.

📝 Notes

  • Available since jQuery 1.3 — returns undefined.
  • Takes no arguments — call with empty parentheses.
  • Stops remaining handlers on the same element and stops bubbling.
  • Implicitly calls event.stopPropagation() — parent handlers do not run.
  • Does not call preventDefault() — cancel defaults separately if needed.
  • return false in jQuery handlers calls preventDefault plus stopPropagation, not stopImmediatePropagation.
  • Use event.isImmediatePropagationStopped() (jQuery 1.3+) to check whether this method was called.

Browser Support

event.stopImmediatePropagation() is part of jQuery’s normalized event object since jQuery 1.3+. It wraps the native DOM stopImmediatePropagation() method so halting the handler queue and stopping bubbling works consistently across browsers jQuery supports.

jQuery 1.3+ · all browsers

jQuery event.stopImmediatePropagation()

Halt handler queues and stop bubbling reliably.

100% Universal
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
stopImmediatePropagation() undefined

Bottom line: Call stopImmediatePropagation() to halt the queue — call isImmediatePropagationStopped() to verify.

Conclusion

event.stopImmediatePropagation() is the strongest stop available on jQuery’s event object — it skips remaining handlers on the same element and prevents bubbling. The official p/div demo shows how it blocks a second p handler while leaving sibling div handlers untouched.

Reach for it when one handler must own the dispatch — validation, primary actions, or plugin conflicts — and use isImmediatePropagationStopped() when later code needs to detect whether the queue was already halted.

💡 Best Practices

✅ Do

  • Call event.stopImmediatePropagation() explicitly when you must skip remaining handlers
  • Bind the owning handler first if it should run before others
  • Pair with isImmediatePropagationStopped() in cooperative multi-handler setups
  • Use when validation failure should block all subsequent handlers on the element
  • Prefer stopPropagation when same-element handlers should still run

❌ Don’t

  • Confuse with stopPropagation() — they halt different things
  • Assume return false stops the same-element handler queue
  • Call stopImmediatePropagation when stopPropagation alone is enough
  • Use it to cancel default browser actions — call preventDefault instead
  • Stop immediate propagation on delegated events expecting to block handlers below in the DOM tree that already ran

Key Takeaways

Knowledge Unlocked

Five things to remember about stopImmediatePropagation()

Halt handler queues and bubbling.

5
Core concepts
02

Returns

undefined

Value
demo 03

Official

p vs div

Demo
queue 04

Same element

Handler queue

Use
05

Not stopProp

Stronger stop

Compare

❓ Frequently Asked Questions

event.stopImmediatePropagation() keeps any remaining handlers on the same element from running and prevents the event from bubbling up the DOM tree. It implicitly calls stopPropagation(). It takes no arguments and returns undefined. Available since jQuery 1.3.
Call it when an early handler on an element must halt the handler queue — for example, a validation handler that should block analytics and save handlers bound to the same button, or a primary click handler that owns the interaction.
stopPropagation() stops bubbling to parent elements but other handlers on the same element still run. stopImmediatePropagation() stops both remaining same-element handlers and bubbling in one call.
No. In jQuery handlers, return false calls preventDefault() and stopPropagation(), not stopImmediatePropagation(). Remaining handlers on the same element may still run unless you explicitly call stopImmediatePropagation().
Use event.isImmediatePropagationStopped(). It returns true if stopImmediatePropagation() was called on this event object during the current dispatch, and false otherwise.
No. stopImmediatePropagation() affects handler execution and bubbling only. To cancel default actions like link navigation or form submit, call event.preventDefault() separately.
Did you know?

event.stopImmediatePropagation() was added in jQuery 1.3 alongside isImmediatePropagationStopped(), isPropagationStopped(), and isDefaultPrevented() — giving handlers both action methods and read-only checks for the three main event flags. The behavior mirrors DOM Level 3’s native stopImmediatePropagation().

Next: event.isImmediatePropagationStopped()

Check whether stopImmediatePropagation() was called on the event object.

isImmediatePropagationStopped() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful