stopPropagation() Event Method
THE WORLD'S LARGEST WEB DEVELOPER SITE

stopPropagation() Event Method

❮ DOM Events ❮ Event Object

Example

Prevent any propagation of the same event:

function func1(event) {
  alert("DIV 1");
  event.stopPropagation();
}
Try it Yourself »

Definition and Usage

The stopPropagation() method prevents propagation of the same event from being called.

Propagation means bubbling up to parent elements or capturing down to child elements.


Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method
stopPropagation() Yes 9.0 Yes Yes Yes

Syntax

event.stopPropagation()

Parameters

None

Technical Details

Return Value: No return value
DOM Version: DOM Level 3 Events

❮ DOM Events ❮ Event Object