title: Jquery to preselect a dropdown value
body: <p>I have this dropdown below which I have taken out of the actual page I need to work on at <a href="http://www.howtoclone.co.uk.gridhosted.co.uk/plasmid-builder" rel="nofollow">http://www.howtoclone.co.uk.gridhosted.co.uk/plasmid-builder</a> where I pass the product ID value from another page to the jquery below to preselect the dropdown 'value'. When I just run this below in isolation it works.</p>
  
  <pre><code>&lt;select name="0product_id[]" class="groupSelect" id="groupsel_0" onchange="productbuilder.update(this.value,0);"&gt;
      &lt;option value="0" class="notag" id="id0_0"&gt;--Select--&lt;/option&gt;
      &lt;option class="notag" value="338" id="id0_338"  &gt;Dual Promoter Puromycin Expression Plasmid - pSF-CMV-PGK-Puro  &gt; £114.00&lt;/option&gt;
      &lt;option class="notag" value="282" id="id0_282"  &gt;EMCV IRES Puromycin Expression Plasmid - pSF-CMV-EMCV-Puro  &gt; £114.00&lt;/option&gt;
      &lt;option class="notag" value="265" id="id0_265"  &gt;FMDV IRES Puromycin Expression Plasmid - pSF-CMV-FMDV-Puro  &gt; £114.00&lt;/option&gt;
      &lt;option class="notag" value="101" id="id0_101"  &gt;Puromycin Selection Plasmid - pSF-CMV-Ub-Puro AscI  &gt; £114.00&lt;/option&gt;
      &lt;option class="notag" value="105" id="id0_105"  &gt;Puromycin Selection SV40 Ori Plasmid - pSF-CMV-Ub-Puro-SV40 Ori SbfI  &gt; £114.00&lt;/option&gt;
      &lt;option class="notag" value="323" id="id0_323"  &gt;Rous Sarcoma Virus Promoter Puromycin Expression Plasmid - pSF-CMV-RSV-Puro  &gt; £114.00&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>and This is the snippet which works to change the value on load:</p>
  
  <pre><code>&lt;script&gt;    
      $( document ).ready(function() {
      $("#groupsel_0 option[value=105]").attr("selected", "selected");    
      });
  &lt;/script&gt; 
  </code></pre>
  
  <p>As soon as I upload it to the site it has no effect. Can anyone help?</p>