XHTML » XHTML Core Tag » onmouseout

Syntax:
onmouseout="action"

The onmouseout event is associated with moving the mouse out of a selected HTML tag (element). In other words, the mouse out event occurred while the HTML element was in focus. Every time you move the mouse out of the element, the script code of the onmouseout 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.

Examples

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML onmouseout Tag Example</title>
</head>
<body>
<input type="button" onmouseout="JavaScript: alert( 'onmouseout event' )" value="Move The Mouse Out Of This Button!" />
</body>
</html>
Output:
Explanation:

In this example, simply place the mouse inside the button element and then move it out. As soon as you move out, an alert appears with a message.

Language(s): XHTML

See Also: