HTML event onmousemove

From Htmlpedia
Jump to: navigation, search

Event Attribute onMouseMove

onMouseMove 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 whilst hovering above the element.


In this example, the user will receive a messagebox saying "You hovered over the text", after moving the mouse/pointing device anywhere over the text "Click me"

<a onmousemove="alert('You moved your mouse over this text')">Hover over me</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