title: Populate Multiple Select Controls with the Same Values using jQuery
body: <p>I have two select controls that I want to populate with the exact same options.</p>
  
  <p>I started with the following code (which does not work):</p>
  
  <pre><code>var result = // raw &lt;option&gt;&lt;/option&gt; html from ajax call
  
  $("#selImbServiceType").html(result);
  $("#selRemitImbServiceType").html(result);
  </code></pre>
  
  <p>If I comment out either of the statements above then the one left works, but when they are both uncommented only the first one works.</p>
  
  <p>Then I changed the code to the following (this works as expected):</p>
  
  <pre><code>var result = // raw &lt;option&gt;&lt;/option&gt; html from ajax call
  
  $("#selImbServiceType,#selRemitImbServiceType").html(result);
  </code></pre>
  
  <p>The second version populates both controls.</p>
  
  <p>I am using jQuery 1.4.4 with Firefox 5.0.1</p>
  
  <p>Any idea why the first version does not work?</p>
  
  <p><strong>result variable HTML</strong></p>
  
  <p>Here is the contents of the result variable:</p>
  
  <pre><code>&lt;option value="27b3dc65-d60c-46e3-8d9c-bdffad8bc25f"&gt;Return To Sender&lt;/option&gt;
  &lt;option value="bcf435c9-d197-4a54-8d90-f4507c2ac505"&gt;Shred And Return Electronically&lt;/option&gt;
  </code></pre>
  
  <p><strong>Surrounding HTML</strong></p>
  
  <pre><code>&lt;div style="overflow:auto;width:100%;"&gt;
    &lt;div style="float:left;width:50%"&gt;
      &lt;span class="dialogControlLabel"&gt;Client&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="listClients" onchange="clientSelectionChanged()"&gt;&lt;/select&gt;
      &lt;span id="spanClientsLoading" style="display:none;"&gt;&lt;img src="/Theme/Images/ajax-loader-fb.gif" alt="loading" width="16" height="11" /&gt;&lt;/span&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;IMB Service Type&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selImbServiceType" name="imbServiceType"&gt;&lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Stream Name&lt;/span&gt;
      &lt;br /&gt;
      &lt;input id="txtStreamName" type="text" maxlength="128" name="streamName" /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Processor Module&lt;/span&gt;
      &lt;br /&gt;
      &lt;input id="txtProcessorModule" type="text" maxlength="256" name="processorModule"/&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Advanced Location Logic Enabled&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selAdvancedLocationLogicEnabled" name="advancedLocationLogicEnabled"&gt;
        &lt;option value="1"&gt;Yes&lt;/option&gt;
        &lt;option value="0"&gt;No&lt;/option&gt;
      &lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Force Mail Enabled&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selForceMailEnabled" name="forceMailEnabled"&gt;
        &lt;option value="1"&gt;Yes&lt;/option&gt;
        &lt;option value="0"&gt;No&lt;/option&gt;
      &lt;/select&gt;
    &lt;/div&gt;
    &lt;div style="float:right;width:50%"&gt;
      &lt;span class="dialogControlLabel"&gt;File Stream Configuration&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selFileStreamConfig"&gt;&lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Remit IMB Service Type&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selRemitImbServiceType" name="remitImbServiceType"&gt;&lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;NCOA Enabled&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selNcoaEnabled" name="ncoaEnabled"&gt;
        &lt;option value="1"&gt;Yes&lt;/option&gt;
        &lt;option value="0"&gt;No&lt;/option&gt;
      &lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Skip Logic Enabled&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selSkipLogicEnabled" name="skipLogicEnabled"&gt;
        &lt;option value="1"&gt;Yes&lt;/option&gt;
        &lt;option value="0"&gt;No&lt;/option&gt;
      &lt;/select&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;span class="dialogControlLabel"&gt;Active&lt;/span&gt;
      &lt;br /&gt;
      &lt;select id="selActive" name="active"&gt;
        &lt;option value="1"&gt;Yes&lt;/option&gt;
        &lt;option value="0"&gt;No&lt;/option&gt;
      &lt;/select&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>