The onmousewheel attribute is an inline handler for the obsolete mousewheel event. It fires while a mouse wheel or similar device is operated over the element.
MDN: it was never part of any standard, and Firefox never implemented it. Use the standard onwheel attribute (or addEventListener("wheel", …)) for new work. Related scroll position changes use onscroll.
Deprecated.
Avoid in new projects. Prefer the standard wheel event via onwheel.
Non-standard.
Not standardized. Limited and inconsistent support — unsuitable for production.
Syntax
HTML Syntax
syntax.html
<element onmousewheel="script">
Legacy only. Prefer: <element onwheel="script"> or element.addEventListener("wheel", handler).
Values
Attribute Values
The attribute value is a script. Patterns you may see in old pages:
Value / pattern
Description
Try it
handler(event)
Legacy: read wheelDelta (sign/units vary by browser)
Most problems come from treating mousewheel as a standard, portable API.
firefox
No mousewheel in Firefox
MDN: Firefox never implemented it. Any feature that depends only on onmousewheel is broken there.
units
wheelDelta is inconsistent
Chrome, Safari, and older engines disagree on magnitude and acceleration. Prefer deltaY on wheel.
sign
Sign differs from wheel
Legacy wheelDelta sign convention is not the same as DOM Level 3 wheel deltas. Do not mix formulas blindly.
a11y
Wheel-only controls exclude many users
Offer buttons or keyboard controls for zoom/size changes. Touch devices often have no physical wheel.
scroll
Wheel ≠ scroll
wheel/mousewheel report device movement. scroll reports position change. Listen for the one that matches your goal.
Compatibility
Browser Support
onmousewheel is a deprecated, non-standard HTML event handler. Prefer onwheel for new work.
✓ Deprecated · Non-standard
onmousewheel
Never standardized. Supported historically in Chromium/WebKit-family browsers for legacy pages. Not implemented in Firefox. Use the standard wheel event instead.
0%Recommended for new work
Google ChromeLegacy support
Legacy only
Mozilla FirefoxNot implemented
No support
Apple SafariLegacy support
Legacy only
Microsoft EdgeLegacy support
Legacy only
OperaLegacy support
Legacy only
Samsung InternetLegacy (Chromium)
Legacy only
Internet ExplorerLegacy support
Supported
onmousewheelDeprecated — use onwheel
Bottom line: Do not use onmousewheel in new pages. Teach it only to read old code — ship onwheel / addEventListener("wheel").
Remember
Key Takeaways
Status: deprecated and non-standard — not for new projects.
Replace with:onwheel / addEventListener("wheel").
Firefox: never had mousewheel — use wheel.
A11y: do not make critical UI wheel-only.
One line: recognize onmousewheel in old pages — ship onwheel in new ones.
Frequently Asked Questions
It is an inline handler for the obsolete, non-standard mousewheel event, fired while a mouse wheel or similar device is operated over the element. MDN recommends the standard wheel event (onwheel) instead.
Yes. MDN marks mousewheel as Deprecated and Non-standard. It was never in a web standard and was never implemented by Firefox.
Use the standard onwheel attribute or element.addEventListener("wheel", handler). Read deltaY / deltaX on the WheelEvent.
No. Firefox never implemented mousewheel. Use wheel, which Firefox supports.
A legacy property on mousewheel events. Positive often means scrolled away from the user. Values differ by browser and OS — another reason to prefer the standard wheel event’s deltaY.
mousewheel / wheel report wheel-device movement. scroll fires when an element’s scroll position actually changes. You can wheel without scrolling, and scroll without a wheel.