var test = document.getElementById('test');
console.log(test.offsetHeight);
<div style="height: 30px;" id="test">
<p>ffffffffff</p>
<p>gggggggggg</p>
<p>aaaaaaaaaa</p>
<p>dddddddddd</p>
</div>
test
div is overflow
and more than 30px
: so how to get accurate height?