HTML onmousewheel Attribute

❮ HTML Attributes

Deprecated: Not Supported in HTML5.


<div id="demo" onmousewheel="myFunction()">


The onmousewheel attribute run when the mouse wheel is rolled up or down over an element.

Note: The onmousewheel attribute is deprecated, you can use the onwheel attribute instead.

Standard Syntax

<element onmousewheel="script">

Browser Support


Applies to:

The onmousewheel attribute can be used on the following element:

Element Attribute
All HTML elements. onmousewheel

Attribute Values

Value Description
script Specifies the script to be run on when a mouse wheel is being scrolled over an element.
❮ HTML Attributes