stopPropagation()

noun

say it: “STOP prop-uh-GAY-shun” /stɒp ˌprɒpəˈɡeɪʃən/

An event method that stops an event from traveling any further up to the elements around the one it happened on.

What does stopPropagation() do in JavaScript?

stopPropagation() — An Event method that stops the event from moving to other elements.

button.addEventListener("click", event => {
    event.stopPropagation();
});

In a sentence

  • “I called stopPropagation() in the delete button's listener, so clicking it no longer opens the whole card as well.”

Level: Freelancer · More JavaScript terms at this level

Updated