onmouseover event

 The onmouseover event is used to determine whether the user moves the mouse to a specific object or web page element. If the mouse is moved to the element where the onmouseover event is inserted, a specific JavaScript function will be triggered to start a specific task, such as when the mouse is Move to a picture to automatically display the introduction picture of the dialog window, or move the mouse to a thumbnail of a web page, and the original large picture will be automatically displayed. It is a common way of onmouseover event application, and all major browsers Support onmouseover event.


onmouseover event syntax

onmouseover = "JavaScript function to be triggered"


The "JavaScript function to be triggered" in the grammar is a necessary item. The function of onmouseover is only to monitor the situation where the user moves the mouse over the element. The real task is to use various functions or functions of JavaScript. The following is a preparation Very simple reference example.

onmouseover event example
<div onmouseover="alert('See the test results!')" style="padding:5px;background-color:#FFE5B5;">
Mouse cursor moved here to test
</div>

The effect of this example is that when the mouse moves over 
any place on the 
DIV block (pink-orange block), a dialog window will pop up and display "See the test result!" This result is more important. "onmouseover" "alert('See the test result!')"" In this part, onmouseover notices that the mouse moves through the DIV block and immediately displays the text through alert. The padding in the example is the inner margin and the background-color is The background color of the DIV block.

Post a Comment

0 Comments