<span id="elem">Hello!</span>
<script>
  alert( getComputedStyle(elem).width ); // auto
</script>
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.