title: Javascript get element height not working
body: <p>I need to toggle button based on element height. Tried offsetHeight, clientHeight and scrollHeight, none of those work. Set alert() for testing purposes, aways return undefined. </p>
  
  <pre><code>    window.onload = function (){
      var wrapperHeight = document.getElementsByClassName("panel").offsetHeight;
      var innerHeight = document.getElementsByClassName("description-content").offsetHeight;
      var button = document.getElementsByClassName("accordion");
      if(innerHeight &gt; wrapperHeight){
          button.style.display = "block";
      }
      alert(innerHeight);
  }
  </code></pre>