diff --git a/files/en-us/web/api/element/mouseenter_event/index.md b/files/en-us/web/api/element/mouseenter_event/index.md index bea08b6bbe3d268..35095cd156705b7 100644 --- a/files/en-us/web/api/element/mouseenter_event/index.md +++ b/files/en-us/web/api/element/mouseenter_event/index.md @@ -10,6 +10,8 @@ browser-compat: api.Element.mouseenter_event The **`mouseenter`** event is fired at an {{domxref("Element")}} when a pointing device (usually a mouse) is initially moved so that its hotspot is within the element at which the event was fired. +Note that "moving into an event" refers to the element's position in the DOM tree, not to its visual position. For example, if a child element is positioned so it is placed outside its parent, then moving into the child element will trigger `mouseenter` on the parent element, even though the pointer is still outside the bounds of the parent element. + ## Syntax Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. diff --git a/files/en-us/web/api/element/mouseleave_event/index.md b/files/en-us/web/api/element/mouseleave_event/index.md index f74770158784dbf..ccfb9c2b87f6ad8 100644 --- a/files/en-us/web/api/element/mouseleave_event/index.md +++ b/files/en-us/web/api/element/mouseleave_event/index.md @@ -14,6 +14,8 @@ The **`mouseleave`** event is fired at an {{domxref("Element")}} when the cursor The `mouseleave` and `mouseout` events will not be triggered when the element is replaced or removed from the DOM. +Note that "moving out of an event" refers to the element's position in the DOM tree, not to its visual position. For example, if two sibling elements are positioned so one is placed inside the other, then moving from the outer element into the inner element will trigger `mouseleave` on the outer element, even though the pointer is still in the bounds of the outer element. + ## Syntax Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.