HTML onmouseover Event Attribute

Example

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

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

Try It Yourself

Browser Support

IE Firefox Chrome Safari Opera

All major browsers support the onmouseover attribute.

Definition and Usage

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

Note:The onmouseover 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 onmouseover="script">

Attribute Value

Value Description
script Script runs when onmouseover occurs.