Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery event.stopImmediatePropagation() method

jQuery event.stopImmediatePropagation() method

jQuery event methods 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 executed");

    event.stopImmediatePropagation();

});

$("div").click(function(event){

    alert("Event handler 2 executed");

});

$("div").click(function(event){

    alert("Event handler 3 executed");

});

Try it »


Definition and Usage

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

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

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


Syntax

event

.stopImmediatePropagation()

Parameters Description
event Required.event The parameters come from the event binding function.

jQuery event methods jQuery event methods