The stopPropagation()
method prevents the event from propagating (bubbling) up or down the DOM tree. This is useful for preventing parent elements from handling events triggered by child elements.
Tags: basic, JavaScript, events
URL: https://www.tiktok.com/@jsmentoring/photo/7454613743649951008