Easy Tutorial
❮ Eff Slideup Misc Grep ❯

jQuery event.stopImmediatePropagation() Method

jQuery Event Methods

Example

Execute the first event handler and prevent the remaining event handlers from being executed:

$("div").click(function(event){
    alert("Event handler 1 is executed");
    event.stopImmediatePropagation();
});
$("div").click(function(event){
    alert("Event handler 2 is executed");
});
$("div").click(function(event){
    alert("Event handler 3 is executed");
});

Definition and Usage

The event.stopImmediatePropagation() method prevents the remaining event handlers from being executed.

This method also prevents the event from bubbling up the DOM tree.

Tip: Use the event.isImmediatePropagationStopped() method to check whether this method was called on the specified event.


Syntax

Parameter Description
event Required. The event parameter comes from the event binding function.

jQuery Event Methods

❮ Eff Slideup Misc Grep ❯