HTML onmousemove event property

Example

Execute a JavaScript when the mouse pointer moves over the image:

<img onmousemove="bigImg(this)" src="smiley.gif" alt="Smiley">

Try it yourself

Browser support

IE Firefox Chrome Safari Opera

All major browsers support the onmousemove attribute.

Definition and usage

The onmousemove attribute triggers when the mouse pointer moves over the element.

Note:The onmousemove attribute is not applicable to the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> or <title>.

Differences between HTML 4.01 and HTML5

None.

Syntax

<element onmousemove="script">

Attribute value

Value Description
script Script executed when onmousemove occurs.