calculate height of children of a div in jquery
<p>I want to  match height of parent with the total height of its children, so that it's content does not flow out of its border. I'm trying following code : </p>

<pre><code> $("#leftcolumn").each(function(){
     totalHeight=totalHeight+$(this).height();
  });
</code></pre>

<p>Will it iterate through all the children of div ? Sometimes, it works sometime don't.
Also, I tried following assuming that it will consider all its children, but the result is strange and it gives height double of the original.</p>

<pre><code> $("#leftcolumn &gt; *").each(function(){
   totalHeight=totalHeight+$(this).height();
 });
</code></pre>

<p>Thanks in advance</p>
