The stopPropagation() method is used to stop propagation of event calling. That is a parent event is called we can stop the propagation of calling its children by using the stopProagration() method and vice-versa.
Return Value: It does not returns any value.
Example: In this example when checkbox is not checked and inner div is clicked then confirm box is shown 2 times (one for inner div and other for outer div). But when checkbox is checked and inner div is clicked again then confirm box is shown only once due to the stopPropagation() event method.
Clicking Inner Div with checkbox unchecked: Confirm box will be shown twice.
After checkbox is checked: Confirm box is shown only once.
Supported Browsers: The browser supported by stopPropagation() Event method are listed below:
- Apple Safari
- Google Chrome
- Internet Explorer 9.0
- jQuery | event.stopPropagation() Method
- HTML | DOM createEvent() Event Method
- HTML | DOM onsubmit Event
- HTML | DOM ondragover Event
- HTML | DOM onkeypress Event
- HTML | DOM onloadeddata Event
- HTML | DOM onkeyup Event
- HTML | DOM oninvalid Event
- HTML | DOM onload Event
- HTML | DOM onseeked Event
- HTML | DOM onseeking Event
- HTML | DOM onended Event
- HTML | DOM onfocus Event
- HTML | DOM onerror Event
- HTML | DOM onvolumechange Event
- HTML | DOM onloadedmetadata Event
- HTML | DOM onopen Event
- HTML | DOM onshow Event
- HTML | DOM fullscreenerror Event
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.