onmousewheel

The onmousewheel event is triggered when the mouse wheel is scrolled up or down over an element. This attribute is now deprecated.
The deprecated and non-standard mousewheel event triggers asynchronously on an element when a mouse wheel or similar input device is used. This event was never included in any official web standard. Although some browsers implemented it, Firefox never supported it.

onmousewheel event

The onmousewheel event activates a <script> when the mouse wheel is scrolled over an element. It is commonly used to create custom scrolling effects or zoom functionality in web applications.

This functionality is no longer advised for use. While some browsers may still support it, it has either been removed from web standards, is being phased out, or remains available only for backward compatibility. It is best to avoid using this feature in new projects and update older implementations where possible. Refer to the compatibility table at the bottom of this page to determine its current support. Keep in mind that this feature could stop working at any time.
This functionality is not officially standardized and should not be used in live web applications. It may not be supported by all browsers, can cause compatibility issues, and its behavior might change in future updates.

Syntax

You can use the event name with methods like addEventListener() or by assigning it to an event handler property.

script.js
addEventListener("mousewheel", (event) => {});
onmousewheel = (event) => {};

Conclusion

The onmousewheel event is used to trigger actions when the mouse wheel is scrolled over an element. While it is commonly used for custom scrolling and zoom effects, it is now deprecated. Developers are encouraged to use alternative methods like wheel for better compatibility and support.