title: Set width and height of a DIV based on another div
body: <p>How do I set width and height of a DIV based on another div?</p>
  
  <p>This is how I've done it but it works only when the <code>alert</code> is present??</p>
  
  <pre><code>var readyC = setInterval(function() {
    if (Condition) {
      $('#divAA').width($('#divBB').width()).height($('#divBB').height()); 
            //alert($('#divBB').width())  // works when this is uncommented?? 
    }
    clearInterval(readyC);
  }, 10);
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Fixed typo:</p>
  
  <p><code>$('#divBB'+i)</code> to <code>$('#divBB')</code></p>