EVENT:  onmouseover

onmouseover="action"
 
The onmouseover event is associated with moving the mouse over a selected HTML tag (element). In other words, the mouse over event occurred while the HTML element was in focus. Every time you move the mouse over the element, the script code of the onmouseover is executed. This script can also call functions or subroutines which contain code that you want to run when this event occurs.
 
The five mouse events are: onmousedown, onmousemove, onmouseout, onmouseover, and onmouseup.
 
In this example, simply move the mouse over on the button element. As soon as you move over, an alert is displayed with a message.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML onmouseover Tag Example</title>
</head>
<body>
<input type="button" onmouseover="JavaScript: alert( 'onmouseover event' )" value="Move The Mouse Over This Button!" />
</body>
</html>

 
Output:


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information