<div id='test'>Test</div> <script> var val=document.getElementById('test').offsetWidth; alert(val); </script>
<div id='test'>Test</div> 2 3 <script> 4 var val=document.getElementById('test').offsetHeight; 5 alert(val); 6 </script>