When you enter a DOM element, an event will occur mouseover. When you move the mouse around the current element, an event does not occur, since mouseoverfor input.
However, this rule does not apply to child nodes. If you move the mouse over the child nodes, the event mouseoverwill be fired again and again, although there is no new event, since we are still in the original parent.
See an example . If we move the mouse over the parent element (actually on its textNode), nothing new will happen, but if we move on to the child element (still on the parent), it will fire the event mouseoveragain and again. In fact, it will fire a mouse event every time the mouse enters elements (even inside the original parent element).
How can we do it mouseoveronly once to move around the entire parent (source element in addEventListener)? In this example, I want to avoid shooting at an event by moving the mouse to a child.
source
share