JSFiddle - React, Tailwind, and code Playground

HTML

<p>Scroll me.</p>

JavaScript

$('html').on ('DOMMouseScroll', function (e) {
    var delta = e.originalEvent.detail;
    
    if (delta < 0) {
        $('p').text ('You scrolled up');
    } else if (delta > 0) {
        $('p').text ('You scrolled down');
    }
    
});

$('html').on ('mousewheel', function (e) {
    var delta = e.originalEvent.wheelDelta;
    
    if (delta < 0) {
        $('p').text ('You scrolled down');
    } else if (delta > 0) {
        $('p').text ('You scrolled up');
    }
});