Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <title>{{ TITLE }}</title>
    <meta name="description" content="" />
  </head>
  
  <body>
    <div class="ct">
      derp.
    </div>
    <div id="ow"></div>
    <div id="cs"></div>
  </body>
</html>
 
.ct {
  padding: 10px;
  border: 1px black solid;
}
 
var $ct = document.querySelectorAll('.ct');
document.getElementById('ow').innerHTML = "offsetWidth = " + $ct[0].offsetWidth;
document.getElementById('cs').innerHTML = "width = " +  window.getComputedStyle($ct[0]).width;
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
founddramapro
0viewers