title: Getting Div Container Height In Javascript When Div Contains Floated Content (Without jQuery)
body: <p>I'm trying to get the height of a div container that has no height initially set and contains a floated element.  The <code>offsetHeight</code> property keeps coming up <code>0</code>.  I am able to get the height if I set the containing div's overflow property to <code>hidden</code>.  Is there a better method than this?</p>
  
  <p>I have an example in jsFiddle - <a href="http://jsfiddle.net/6RQMb/" rel="nofollow">http://jsfiddle.net/6RQMb/</a>.  It's my first time using jsFiddle for testing, so let me know if I did anything incorrectly...</p>
  
  <p>In case I messed something up with jsFiddle (and because stackoverflow requested it), here's the example info:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="container"&gt;&lt;p&gt;Some text that gives this element height&lt;/p&gt;&lt;/div&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>p {float:left;}
  
  /* uncomment next line and it works, without it the alert comes back with 0
  
  #container {overflow:hidden;}
  
  */
  </code></pre>
  
  <p>JAVASCRIPT</p>
  
  <pre><code>alert( document.getElementById('container').offsetHeight );
  </code></pre>