Document directory
- Syntax
- HTML tags that support this event:
- Javascript objects that support this event:
- Output: (move the mouse over the image ):
- Output:
Http://www.w3school.com.cn/htmldom/event_onmouseover.asp
Definition and usage
The onmouseover time occurs when the mouse pointer moves to the specified object.
Syntax
onmouseover="SomeJavaScriptCode"
Parameters |
Description |
Sometriccriptcode |
Required. Specifies the JavaScript code executed when the event occurs. |
HTML tags that support this event:
<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>,<caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>,<form>, Javascript objects that support this event:
layer, link
Instance 1
In the following example, a dialog box is displayed when you move the cursor over the image:
Onmouseover = "alert ('Place your mouse on the picture! ')"/>
Output: (move the mouse over the image ):
Instance 2
In the following example, we will add an image on the webpage as the connection button, and then we will add the onmouseover and onmouseout events, in this way, two JavaScript functions can be run to switch between the two images:
onmouseover="mouseOver()" onmouseout="mouseOut()"></a></body>
Output:
Tiy
-
Onmouseover
-
How to Use onmouseover.