Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

HTML onmousewheel Attribute


Definition and Usage

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

Deprecated. The onmousewheel attribute is deprecated, you should use the onwheel attribute instead.


Applies to

The onmousewheel attribute is part of the Event Attributes, and can be used on any HTML elements.

Elements Event
All HTML elements onmousewheel

Example

Img Example

Execute a JavaScript when the user rolls the mouse wheel over a <div> element:

<div onwmousewheel="myFunction()">Roll the mouse wheel over me</div>
Try it Yourself »

Browser Support

Event Attribute
onmousewheel Yes Yes Not supported Yes Yes