JSFiddle - React, Tailwind, and code Playground

HTML

<div class="loader">
    <p>test</p>  
    <p>test</p>  
    <p>test</p>  
    <p>test</p>  
    <p>test</p>
    <p>test</p>  
    <p>test</p>  
    <p>test</p>  
    <p>test</p>  
    <p>test</p>
</div>
	<p id="info">0</p>

CSS

.loader {
	   width: 500px;
	   height: 300px;
	   overflow: auto;
	}
	
	#info {
	color: red;
	font-weight: bold;
	}

JavaScript

$('.loader').scroll(function(){
           var top = $(this).scrollTop();
           $('#info').text(top);
});