how to stop bubbling in javascript
snippet in javascript

how to stop bubbling in javascript


  alert("The span element was clicked.");

  alert("The p element was clicked.");

  alert("The div element was clicked.");

how to prevent event capturing in javascript


how to prevent event button click capturing to tag/div/icon
easiest way OPTION 1 with CSS:
button > * {
  pointer-events: none;

OPTION 2 with javascript:
use e.currentTarget.children ;

OPTION 3 with Javascript:
use'selector') to locate the child, not e.currentTarget;