onmouseoverEvent

事件对象参考手册Event Object

Examples

Execute JavaScript code when the mouse pointer moves over an image:

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

Try it Yourself »

Definition and Usage

The onmouseover event occurs when the mouse pointer moves onto a specified element.

Syntax

In HTML:

<element onmouseover="SomeJavaScriptCode">

In JavaScript:

object.onmouseover=function(){SomeJavaScriptCode};

Parameters Description
SomeJavaScriptCode Required. Specifies the JavaScript to execute when the event occurs.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onmouseover event.


HTML tags that support this event:

The onmouseover attribute can be used on all HTML elements, except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.


事件对象参考手册Event Object Other Extensions