YouTip LogoYouTip

Ev Onmousemove

# HTML onmousemove Event Attribute The `onmousemove` event attribute triggers a script when the mouse pointer moves over a specified element. It is a highly responsive event used to track real-time cursor coordinates and create interactive, dynamic user interfaces. --- ## Introduction The `onmousemove` attribute is part of the HTML Event Attributes group. It fires continuously as long as the user's mouse pointer is moving within the boundaries of the element to which it is attached. ### Browser Support | Chrome | Edge/IE | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | | Yes | Yes | Yes | Yes | Yes | All major modern browsers fully support the `onmousemove` event attribute. --- ## Syntax and Usage ### HTML Inline Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | *script* | The JavaScript code or function to execute when the `onmousemove` event is triggered. | --- ## Code Examples ### Example 1: Basic Inline Usage (Image Hover Effect) This example demonstrates how to trigger a function that modifies an element's size when the mouse moves over it. ```html onmousemove Example

Move the mouse pointer over the smiley face to enlarge it:

Smiley Face ``` ### Example 2: Tracking Real-Time Mouse Coordinates Because `onmousemove` fires continuously, it is ideal for capturing the exact coordinates of the cursor. ```html Track Mouse Coordinates

Move your mouse inside the box below:

Move mouse here...

``` --- ## Considerations and Best Practices ### Unsupported Elements The `onmousemove` attribute cannot be used with the following HTML tags: * `` * `do>` * `
` * `` * `` * `