onmousemoveEvent
Examples
Execute JavaScript code after the mouse pointer moves over the specified element:
<div onmousemove="myFunction()">Move the mouse pointer here.</div>
Try it Yourself »
Definition and Usage
The onmousemove event occurs when the mouse pointer moves over the specified object.
Syntax
In HTML:
<element
onmousemove="SomeJavaScriptCode">
In JavaScript:
object.onmousemove=function(){SomeJavaScriptCode};
| Parameter | Description |
|---|---|
| SomeJavaScriptCode | Required. Specifies the JavaScript to execute when the event occurs. |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the onmousemove event
HTML tags that support this event:
The onmousemove attribute can be used on HTML elements, except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.
Event Object Other Extensions