HTML onmousemove event attribute

Example

Execute a JavaScript block 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 that runs when onmousemove occurs.