title: Calculate height of div's children using jQuery
body: <p>I want to match parent's height with the total height of its' children, so the content does not flow out from parent's border. I'm using the following code : </p>
  
  <pre><code> $("#leftcolumn").each(function(){
       totalHeight=totalHeight+$(this).height();
    });
  </code></pre>
  
  <p>Will it iterate through all the div's children? Sometimes, it works sometimes it doesn't.</p>
  
  <p>Also, I tried following code, assuming it will consider all its children. But the result is strange and gives doubled height from the correct result.</p>
  
  <pre><code> $("#leftcolumn &gt; *").each(function(){
     totalHeight=totalHeight+$(this).height();
   });
  </code></pre>
  
  <p>Thanks in advance.</p>