Prevents further propagation of the current event in the capturing and bubbling phases.
Syntax
event.stopPropagation();
Example
See Example 5: Event Propagation in the Examples chapter for a more detailed example of this method and event propagation in the DOM.
Notes
See the DOM specification for the explanation of event flow. (The DOM Level 3 Events draft has an illustration.)
preventDefault is a complementary method that can be used to prevent the default action of the event from happening.
Specifications
Specification | Status | Comment |
---|---|---|
DOM The definition of 'Event.stopPropagation()' in that specification. |
Living Standard | |
DOM4 The definition of 'Event.stopPropagation()' in that specification. |
Recommendation | |
Document Object Model (DOM) Level 2 Events Specification The definition of 'Event.stopPropagation()' in that specification. |
Recommendation | Initial definition |
Browser Compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | 9 | (Yes) | (Yes) |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | ? | (Yes) | (Yes) |
Document Tags and Contributors
Tags:
Contributors to this page:
koroliov,
adius,
cvrebert,
Sebastianz,
fscholz,
teoli,
Loiro,
LouisLazaris,
kscarfone,
rashidtherash,
Kartik_Chadha,
Sheppy,
ytpete,
ethertank,
ziyunfei,
cgack,
dbruant,
Inimino,
Matej Lednar,
Kohei,
Tgr,
Jabez,
Nickolay,
Ptak82,
Dria,
JesseW
Last updated by:
koroliov,