addEventListener can take a third argument that can control the event propagation. So, I listened for a click on my modal screen div and forced refocus on a popup button. Programmatically navigate using React router. Call multiple JavaScript functions in onclick event. Since the content is in the div if you do not stop the event propagation both will receive the click. While using W3Schools, you agree to have read and accepted our, Sets or returns the accesskey attribute of an element, Returns the currently focused element in the document, Attaches an event handler to the document, Displays an alert box with a message and an OK button, Returns whether the "ALT" key was pressed when the mouse event was triggered, Returns a collection of all
elements in the document that have a name attribute, Adds a new child node, to an element, as the last child node, Returns a collection of all