JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wrapper">
<div id="content"></div>
</div>
CSS
#wrapper{
overflow-y: scroll;
height: 200px;
width: 150px;
background-color: yellow;
border: 1px solid black;
}
#content{
height: 500px;
width: 40px;
background-color: red;
border: 1px solid green;
}
JavaScript
// This returns the height
console.log( $('#wrapper').height() );
// These return the scroll height
console.log( $('#wrapper')[0].scrollHeight );
console.log( document.getElementById("wrapper").scrollHeight );
// This will return undefined:
console.log( $('#wrapper').scrollHeight );