cancelBubble() Event Property in JavaScript
cancelBubble() Event Property in JavaScript
The cancelBubble() method is used to prevent event-flow from bubbling up to parent elements. Use stopPropagation() if you want to prevent both bubbling up to parent elements and capturing down to child elements.
Syntax:-
Its syntax is:- event.cancelBubble = true|false