我在下面有这个下拉列表,我已经从我需要在http://www.howtoclone.co.uk.gridhosted.co.uk/plasmid-builder处理的实际页面中取出,我在其中从另一个传递产品 ID 值页面到下面的 jquery 以预选下拉“值”。当我在下面单独运行它时,它可以工作。
<select name="0product_id[]" class="groupSelect" id="groupsel_0" onchange="productbuilder.update(this.value,0);">
<option value="0" class="notag" id="id0_0">--Select--</option>
<option class="notag" value="338" id="id0_338" >Dual Promoter Puromycin Expression Plasmid - pSF-CMV-PGK-Puro > £114.00</option>
<option class="notag" value="282" id="id0_282" >EMCV IRES Puromycin Expression Plasmid - pSF-CMV-EMCV-Puro > £114.00</option>
<option class="notag" value="265" id="id0_265" >FMDV IRES Puromycin Expression Plasmid - pSF-CMV-FMDV-Puro > £114.00</option>
<option class="notag" value="101" id="id0_101" >Puromycin Selection Plasmid - pSF-CMV-Ub-Puro AscI > £114.00</option>
<option class="notag" value="105" id="id0_105" >Puromycin Selection SV40 Ori Plasmid - pSF-CMV-Ub-Puro-SV40 Ori SbfI > £114.00</option>
<option class="notag" value="323" id="id0_323" >Rous Sarcoma Virus Promoter Puromycin Expression Plasmid - pSF-CMV-RSV-Puro > £114.00</option>
</select>
这是用于更改加载值的代码段:
<script>
$( document ).ready(function() {
$("#groupsel_0 option[value=105]").attr("selected", "selected");
});
</script>
一旦我将它上传到网站,它就没有效果。任何人都可以帮忙吗?