Get element offset height - Javascript DOM

Javascript examples for DOM:Element offsetHeight

Description

Get element offset height

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

.test//from   www. j a v  a  2s. c  o  m
{
   height:1px;
}
#test1
{
   margin:1px;
}


      </style> 
      <script type="text/javascript">
    window.onload=( function() {
var a = document.getElementById('test1');
console.log(a.offsetHeight)
    });

      </script> 
   </head> 
   <body> 
      <div id="test1" class="test"></div>  
   </body>
</html>

Related Tutorials