<div id='test'>Test</div> <script> var val=document.getElementById('test').offsetWidth; alert(val); </script>