HTML event onmouseout

From Htmlpedia
Jump to: navigation, search

Event Attribute onMouseOut

onMouseOut is an event attribute, it takes JavaScript-code as a value. The code will be executed when:

  • The user moves their mouse or pointing device out of the confines of the element.


In this example, the user will receive a messagebox saying "You moved your mouse out of this text", after moving the mouse/pointing device anywhere over the text "Hover over me then move the mouse away"

<a onmouseout="alert('You moved your mouse out of this text')">Hover over me then move the mouse away</a>


As this event requires the user to move the mouse, users with impaired motor skills or no mouse may find this difficult or impossible.


onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup