stopPropagation() Event Method in JavaScript
stopPropagation() Event Method in JavaScript
The stopPropagation() method is used to prevent the propagation of the same event from being called. It means it will not invoke either bubbling up i.e, invoking parent events or capturing down i.e, invoking child events.
Syntax:-
Its syntax is:- event.stopPropagation()