jQuery event.stopImmediatePropagation() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Events

Definition

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().

Syntax

Start with these common calls. Keep them short and readable.

jQuery
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
CallWhat it does
event argumentjQuery event object
stopImmediatePropagation()Skip remaining + stop bubble
Handler orderOnly handlers after the call are skipped
preventDefault()Separate — cancels browser default

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Bind more than one handler on the same element (or expect parent handlers).
Step 2In the handler that should win, call event.stopImmediatePropagation().
Step 3Any later handlers on that element will not run.

Return Value

Return ValueDescription
BooleanOften true or false depending on the match or state.
Value / undefinedGetters usually return a value from the first matched element, or undefined when nothing applies.

jQuery Examples

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.

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.

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.

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: event.isImmediatePropagationStopped() Method

Learn how to detect whether stopImmediatePropagation() already ran.

event.isImmediatePropagationStopped() Method tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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