title: How to set width and height dynamically using jQuery
body: <p>I would like to set the width and the height of the <code>div</code> element dynamically using jQuery.</p>
  
  <p>I was trying to replace</p>
  
  <pre><code>&lt;div id="mainTable" style="width:100px; height:200px;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>with this:</p>
  
  <pre><code>$("#mainTable").css("width", "100");
  $("#mainTable").css("height", "200");
  </code></pre>
  
  <p>but, it does not work for me.</p>
  
  <p>Please help to understand why.</p>
  
  <p><strong>Thank you all !</strong></p>
  
  <p>The problem was with the quotation marks on numbers. This works fine:</p>
  
  <pre><code>$("#mainTable").css("width", 100);
  $("#mainTable").css("height", 200);
  </code></pre>