What’s the difference between event.stopPropagation and event.preventDefault?

stopPropagation prevents further propagation of the current event in the capturing and bubbling phases. preventDefault prevents the default action the browser makes on that event. Examples preventDefault stopPropagation With stopPropagation, only the button‘s click handler is called while the div‘s click handler never fires. Where as if you use preventDefault, only the browser’s default action is stopped but the div’s click handler still … Read more