onmouseenter event | mouseenter event
Occurs when the user moves the mouse pointer into the area of an element.
The onmouseenter event is only supported by Internet Explorer, for a cross-browser solution, use the onmouseover event. The only difference between the onmouseenter and onmouseover events is that the onmouseover event propagates up the document hierarchy, while the onmouseenter does not.
Use the onmousemove event to receive a notification when the user moves the mouse pointer over, and the onmouseout event to receive a notification when the user moves the mouse pointer out of an element.Note: the onmouseenter event is not fired during a drag operation. For that case, use the ondragenter event.
How to register:
|object.onmouseenter = handler;|
|object.addEventListener ("mouseenter", handler, useCapture);|
|object.attachEvent ("onmouseenter", handler);|
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
Actions that invoke the onmouseenter event:
- Moving the mouse pointer into an element.
The order of events related to the onmouseenter event:
|Internet Explorer||Firefox, Opera, Google Chrome, Safari|
Example HTML code 1:
This example illustrates the use of the Internet Explorer specific onmouseenter and onmouseleave events:
Example HTML code 2:
A cross-browser solution for the previous example:
Example HTML code 3:
This example dumps the order of events while the mouse moves into, over and out of an element:
User Contributed Comments