Question d’entretien chez Medallia

Javascript events: stopPropagation & stopImmediatePropagation

Réponse à la question d'entretien

Utilisateur anonyme

26 mai 2016

`stopPropagation` prevents the event from propagating to its parents. Say you have registered a `click` event listener to the `body` element, then clicking any other element in the DOM would also trigger this event. `stopImmediatePropagation` is very much like `stopPropagation` except it also prevents other registered event handlers on the same element to fire.