HTML onmousemove Attribute

HTML onmousemove Attribute: This attribute fires when the pointer is moving while it is over an element. This attribute contains a single value script which works when onmousemove attribute called. The onmousemove attribute triggers when the mouse pointer moves over the element.

HTML onmousemove Attribute

This attribute can be applied to all the HTML elements.

Syntax:<element onmousemove = “script”>

Browser Support:

This attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example: for <img> element

<!DOCTYPE html>
<img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32">
function bigImg(x) { = "64px"; = "64px";

function normalImg(x) { = "32px"; = "32px";


HTML onmousemove attribute