title: how to find the size of a div in javascript?
body: <p>i am trying to figure this out:</p>
  
  <p>i have some html and php: </p>
  
  <pre><code>&lt;div class="main" style="height: 800px"&gt;
      &lt;div class="head" style="height: 300px"&lt;/div&gt;
      &lt;div class="container"&gt;
          &lt;?php
          for ($i=0; $i&lt;=$size;$i++){
              echo "&lt;div style="/"height: 20px;/"&gt;line $i&lt;/div&gt;";
          }
          ?&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>now, what i am trying to do is to find the height of the <code>.container</code> div and apply it to <code>$size</code></p>
  
  <p>if the <code>.container</code> height is 100 then i will do something like: <code>$size = 100 / 20</code> or something similar.</p>
  
  <p>The issue is that even if i find the div height it is still on the client side and i might have to do some ajax.</p>
  
  <p>Another problem is that if there is no content in the <code>.container</code> usually there is no height.</p>
  
  <p>in this case i could force the size of <code>.container</code> to be <code>800 - 300</code> but i don't allays know other sizes from different block elements on the page.</p>
  
  <p>i hope i am not to confuse with this question.</p>
  
  <p>any ideas?</p>
  
  <p>Thanks</p>