HTML onwheel Attribute

❮ HTML Attributes


<div onwheel="myFunction()">Roll the mouse wheel over me!</div>


The onwheel attribute specifies the script run when the mouse wheel rolls up or down over an element.

Standard Syntax

<element onwheel="script">

Browser Support


Applies to:

The onwheel attribute can be used on the following element:

Element Attribute
All HTML elements onwheel

Attribute Values

Value Description
script Specifies the script to be run on onwheel.
❮ HTML Attributes