jQuery | event.stopPropagation() Method
The event.stopPropagation() method is an inbuilt method in jQuery which is used to stop the windows propagation. In the DOM tree when setting an event with the child element and the parent element as well then if you hit on the child element event it will call both child and the parent element as well. So with the help of this method this popup will not appear for the other element except selected element.
Parameters: It accepts single parameter which is mandatory. This parameter comes from binding function.
Return Value: This method returns the selected element with specified changes made by stopPropagation() method.
Example: This example illustrates the event.stopPropagation() method.
- Before Clicking the button:
- After Clicking the button: