JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wrapper">
<p>Content text</p>
<p>Content text</p>
<p>Content text</p>
<p>Content text</p>
<p>Content text</p>
<p>Content text</p>
<p>Content text</p>
</div>
CSS
#wrapper{
height: 200px;
overflow: scroll;
border: 1px solid red;
}
JavaScript
$("#wrapper").scroll(function(){
console.log("Scroll Detected");
alert("Scroll Detected");
});