<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
#outerDiv{
height:150px;
width:200px;
border:1px solid black;
overflow: auto;
}
#innerDiv{
height:1500px;
width:2000px;
}
</style>
</head>
<body>
<div id="outerDiv" onscroll="myFunction()">
<div id="innerDiv">Scroll me down and top</div>
</div>
<p id="point"></p>
<script>
var x = document.getElementById("point");
var elem = document.getElementById("outerDiv");
function myFunction(){
x.innerHTML = "scrollTop = " +elem.scrollTop;
}
</script> </body>
</html>