Keep the script simple, and just get every parent element every time. Determine the parent of elements to watch for events; Attach the event listener to the parent element; Use event.target to select the target elements; Do you have any questions regarding the event propagation or event delegation? event.target – is the element where the mouse came over. Supported elements . This allows a user to click on a reference and come back to it later without leaving the current page. The Node.parentElement read-only property returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element. To traverse all the way up to the document's root element (to return grandparents or other ancestors), use the parents () or the parentsUntil () method. The DOM tree: This method only traverse a single level up the DOM tree. It allows us to add an event listener to one parent, and avoid to add many event listeners to specific nodes. For iframes, we can access parent/children windows using: window.frames – a collection of nested window objects, window.parent, window.top are the references to parent and top windows, iframe.contentWindow is the window inside an