jQuery event.stopImmediatePropagation() Method

Beginner
6 min read
Updated: Oct 2026
5 examples
Live preview

What Is event.stopImmediatePropagation()?

event.stopImmediatePropagation() does two things: it skips any remaining handlers on the same element, and it stops bubbling (implicitly calls stopPropagation()). Takes no arguments, returns undefined. Since jQuery 1.3. Check with isImmediatePropagationStopped().

Remember
event.stopImmediatePropagation()   // no args

// Same element: remaining handlers are skipped
// Ancestors: bubbling is stopped (like stopPropagation)

// Need other same-element handlers to still run?
// → use stopPropagation() instead
NeedUse
Skip remaining + stop bubbleevent.stopImmediatePropagation()
Stop bubble onlyevent.stopPropagation()
Check if calledisImmediatePropagationStopped()
Cancel default actionevent.preventDefault()
Bind handlers.on("click", fn)

How to Use stopImmediatePropagation()

Call it early when this handler must own the event completely.

  1. Bind more than one handler on the same element (or expect parent handlers).
  2. In the handler that should win, call event.stopImmediatePropagation().
  3. Any later handlers on that element will not run.
  4. Parent / document handlers will not see the event either.
  5. Optionally check with event.isImmediatePropagationStopped().
PieceRequired?Role
event argumentYesjQuery event object
stopImmediatePropagation()Yes (to halt)Skip remaining + stop bubble
Handler orderYesOnly handlers after the call are skipped
preventDefault()OptionalSeparate — cancels browser default

Pseudocode

Pseudocode
element.on("click", handlerA)
element.on("click", handlerB)   // later
parent.on("click", handlerParent)

when click fires on element:
    run handlerA
    if handlerA calls stopImmediatePropagation():
        skip handlerB
        do not bubble to parent
    else:
        run handlerB
        bubble to parent (unless stopPropagation)

Cheat Sheet

Keep these facts handy while controlling handler queues.

TopicDetail
Syntaxevent.stopImmediatePropagation()
ArgumentsNone
Returnsundefined
SincejQuery 1.3
Same-element handlersRemaining ones skipped
BubblingStopped (calls stopPropagation)
vs stopPropagationThat one still runs same-element handlers
vs return falsefalse ≠ immediate stop

Live Preview

Click the paragraph — handler 2 is skipped. Click the division — its handler still runs. Same idea as the official jQuery API demo.

Click

First p handler calls stopImmediatePropagation() — second p handler never runs.

Log
Click paragraph or division.

jQuery Examples

Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.

Example 1 — Official Demo: Skip Second Handler

First p handler stops immediate; second never runs; div still works.

jQuery
$("p").on("click", function (event) {
  event.stopImmediatePropagation();
  $("#out").append("p handler 1 ran — immediate stopped\n");
});

$("p").on("click", function () {
  $("#out").append("p handler 2 ran (skipped)\n");
});

$("div").on("click", function () {
  $("#out").append("div handler ran\n");
});
Try It Yourself

How It Works

  1. Two p handlers. Bound in order on the same paragraph.
  2. Stop. First calls stopImmediatePropagation().
  3. Skip. Second p handler never executes.
  4. Separate. Clicking div runs its own handler normally.

Example 2 — Block a Later Handler

Primary click handler owns the button; a second handler never runs.

jQuery
$("#buy").on("click", function (event) {
  event.stopImmediatePropagation();
  $("#out").text("Purchase handled by primary handler");
});

$("#buy").on("click", function () {
  $("#out").append(" | analytics tracked");
});
Try It Yourself

How It Works

  1. Primary. First handler handles the purchase UI.
  2. Halt. stopImmediatePropagation() ends the queue.
  3. Analytics. Second handler would track — but is skipped.
  4. Use case. When one handler must fully own the click.

Example 3 — vs stopPropagation()

Same-element handlers still run after stopPropagation, not after immediate.

jQuery
$("#btn-a").on("click", function (event) {
  event.stopPropagation();
  $("#out").append("A1 (stopPropagation)\n");
});
$("#btn-a").on("click", function () {
  $("#out").append("A2 still ran\n");
});

$("#btn-b").on("click", function (event) {
  event.stopImmediatePropagation();
  $("#out").append("B1 (stopImmediate)\n");
});
$("#btn-b").on("click", function () {
  $("#out").append("B2 still ran\n");
});
Try It Yourself

How It Works

  1. Button A. stopPropagation — A2 still runs.
  2. Button B. stopImmediatePropagation — B2 is skipped.
  3. Difference. Immediate also kills the same-element queue.
  4. Choose. Need sibling handlers? Use stopPropagation only.

Example 4 — Block Document + Second Handler

Immediate stop skips the next inner handler and never reaches document.

jQuery
$(document).on("click", function () {
  $("#out").append("document handler ran\n");
});

$("#inner").on("click", function (event) {
  event.stopImmediatePropagation();
  $("#out").append("inner 1 — bubbling stopped\n");
});

$("#inner").on("click", function () {
  $("#out").append("inner 2 (skipped)\n");
});
Try It Yourself

How It Works

  1. Document. Would normally hear bubbling clicks.
  2. Inner 1. Calls stopImmediatePropagation().
  3. Inner 2. Skipped on the same element.
  4. Document. Never runs for this click.

Example 5 — Validation Guard

Fail validation → stop immediate; save handler checks the flag.

jQuery
$("#save").on("click", function (event) {
  if (!$("#name").val()) {
    event.stopImmediatePropagation();
    $("#out").text("Validation failed");
  }
});

$("#save").on("click", function (event) {
  if (event.isImmediatePropagationStopped()) return;
  $("#out").text("Save handler ran");
});
Try It Yourself

How It Works

  1. Check. First handler validates the name field.
  2. Fail. Calls stopImmediatePropagation() and shows an error.
  3. Pass. Second handler runs only if not stopped.
  4. Guard. isImmediatePropagationStopped() is a clear early return.

Edge Cases & Pitfalls

Watch for these when stopping immediate propagation.

vs stop

Stronger than stopPropagation()

stopPropagation still allows other handlers on the same element. Immediate does not.

false

return false is not enough

jQuery’s return false = preventDefault + stopPropagation — not stopImmediatePropagation.

default

Does not cancel defaults

Links still navigate and forms still submit unless you also call preventDefault().

order

Only stops handlers after you

Handlers already bound and run before your call have already executed. Bind order matters.

Browser Support

event.stopImmediatePropagation() has been available since jQuery 1.3. Modern browsers also provide the native method; jQuery normalizes it on the event object. Works wherever your loaded jQuery version runs.

✓ Stable · jQuery 1.3+

event.stopImmediatePropagation()

Supported wherever jQuery 1.3+ is loaded. Prefer jQuery 3.x with .on() for modern multi-handler code.

100% jQuery support
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() 1.3+

Bottom line: Safe for production when one handler must own the event. Pair with isImmediatePropagationStopped() and preventDefault() as needed.

Performance Notes

ApproachCostBest for
stopImmediatePropagation()NegligibleHalting a handler queue early
Many handlers then stopWasted work if lateCall stop in the earliest owning handler
stopPropagation() onlyNegligibleWhen same-element handlers must still run
Unnecessary immediate stopsSurprising bugsUse only when you truly need exclusive control

The method itself is cheap. The win is skipping work — call it as soon as you know no other handler should run.

Key Takeaways

One line: stopImmediatePropagation() means “no more handlers here, and nowhere up the tree.”

Frequently Asked Questions

It keeps any remaining handlers on the same element from running and prevents the event from bubbling up the DOM. It implicitly calls stopPropagation(). Takes no arguments and returns undefined. Available since jQuery 1.3.
When an early handler must halt the handler queue on that element — for example, validation that should block later save/analytics handlers on the same button.
stopPropagation() stops bubbling to parents but other handlers on the same element still run. stopImmediatePropagation() stops both remaining same-element handlers and bubbling.
No. In jQuery, return false calls preventDefault() and stopPropagation(), not stopImmediatePropagation(). Remaining same-element handlers may still run.
Use event.isImmediatePropagationStopped(). It returns true if stopImmediatePropagation() was called on this event object during the current dispatch.
No. It only affects handler execution and bubbling. To cancel link navigation or form submit, call event.preventDefault() separately.

Next: isImmediatePropagationStopped()

Learn how to detect whether stopImmediatePropagation() already ran.

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.

9 people found this page helpful