English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML onmouseout-Event-Attribute

Die onmouseout-Attribute wird verwendet, um den aktuellen Event-Handler für das onmouseout-Ereignis des Elements zu erhalten oder zu setzen

HTML Event Attributes

Online-Beispiel

Führe JavaScript aus, wenn der Mauszeiger über das Bild hinausgeht:

<!DOCTYPE html>
<html>
<head>
<title>Verwendung der HTML onmouseout-Event-Attribute (Grundlagen-Tutorial-Netz)3codebox.com)</title>
</head>
<body>
<img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32">
<p>Wenn der Benutzer den Mauszeiger auf das Bild bewegt, wird die Funktion bigImg() ausgelöst. Diese Funktion vergrößert das Bild.<br>
Wenn der Mauszeiger über das Bild hinausgeht, wird die Funktion normalImg() ausgelöst. Diese Funktion setzt die Höhe und Breite des Bildes auf normal./p>
<script>
function bigImg(x) {
  x.style.height = ""64px";
  x.style.width = ""64px";
}
function normalImg(x) {
  x.style.height = ""32px";
  x.style.width = ""32px";
}
</script>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the onmouseout event attribute

Definition and Usage

The onmouseout attribute is triggered when the mouse pointer moves out of the element.

Hint: The onmouseout attribute is usually used withonmouseoverAttributes

Note: The onmouseout attribute cannot be used on the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.

HTML 4.01 With HTML5Differences

None.

Syntax

<element onmouseout="script">

Attribute Value

ValueDescription
scriptSpecifies the script to be executed when the onmouseout event is triggered.
HTML Event Attributes