title: Using jQuery to increase the size attribute of HTML select box
body: <p>I have an HTML select box with a <code>size</code> of 1 to start and would like to increase that each time a new option is inserting into the box. I am able to insert the options with no problem but I can't figure out the correct way to increase the size. I tried following <a href="https://stackoverflow.com/questions/65206/using-jquery-how-can-i-dynamically-set-the-size-attribute-of-a-select-box">this SO post</a> but the code is not working and I am not really seeing what I am missing.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>var currentSize = $("#SelectedProjects").attr("size");
  currentSize++;
  alert(currentSize);
  $("SelectedProjects").attr("size", currentSize);
  </code></pre>
  
  <p>As a test I am alerting the <code>currentSize</code> and that alert returns the right number but when I try to assign it the box does not grow. What am I missing here?</p>