JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">
 Yuppie Awesome Test-Text
</div>

CSS

@keyframes box {
    0%   {top:5px;}
    100% {top:100px;}
}

#test {
  width:100px;
  height:auto;
  position:absolute;
  background-color:#122345;
  animation-name: box;
  animation-duration: 4s;
}

JavaScript

var box_height = document.getElementById("test").offsetHeight;
alert(box_height);
// ====> Jetzt solltest du die offset-Height-Angabe erhalten