JavaScript event.stopImmediatePropagation() Method

You are Here:

JavaScript event.stopImmediatePropagation() Method

The event.stopImmediatePropagation() method prevents other listeners of the same event from being called. If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <h2 onclick="myFunction(event)" onclick="myOtherFunction()">click me</h2> <script> function myFunction(e){ alert("alert 1"); e.stopImmediatePropagation(); alert("alert 2"); } function myOtherFunction(){ alert("alert 3"); } </script> </body> </html>

Syntax

event.stopImmediatePropagation()

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author