jQuery | event.isImmediatePropagationStopped() Method
The isImmediatePropagationStopped() Method in jQuery is used to check whether this method was called for the event or not. If it was called then it will be “true” or else “false”.
Syntax:
$(selector).isImmediatePropagationStopped()
Parameter: This method accepts only one parameter as a selector which is used to select the element.
Return value: This method returns true if event.stopImmediatePropagation() is called or it will return false if not called.
Example-1:
<!DOCTYPE html> <html> <head> <script src= </script> <style> body { width: 60%; height: 40%; padding: 20px; border: 2px solid green; } div { padding: 5px; display: block; background-color: lightgrey; font-size: 20px; } </style> <script> $(document).ready(function() { $("div").click(function(event) { event.stopImmediatePropagation(); alert( "Was event.stopImmediatePropagation() called: " + event.isImmediatePropagationStopped()); }); }); </script> </head> <body> <div>Welcome to GeeksforGeeks..!</div> </body> </html> |
Output:
Before click on the div element:

After click on the div element:

Example-2:
<!DOCTYPE html> <html> <head> <script src= </script> <style> body { width: 60%; height: 40%; padding: 20px; border: 2px solid green; } div { padding: 5px; display: block; background-color: lightgrey; font-size: 20px; } </style> <script> $(document).ready(function() { $("div").click(function(event) { alert( "Value of event.stopImmediatePropagation() called: " + event.isImmediatePropagationStopped()); }); }); </script> </head> <body> <div>Welcome to GeeksforGeeks..!</div> </body> </html> |
Output:
Before click on the “div” element:

After click on the “div” element:

Recommended Posts:
- jQuery | add() method with Example
- jQuery | before() Method
- jQuery | css() Method
- jQuery | off() Method
- jQuery | die() Method
- jQuery | is() Method
- jQuery | get() Method
- jQuery | param() Method
- jQuery | trigger() Method
- jQuery | triggerHandler() Method
- jQuery | text() Method
- jQuery | ajax() Method
- jQuery | delegate() Method
- jQuery | attr() Method
- jQuery | ajaxSetup() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.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.



