Picture switching onmouseover event

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.