如何在JavaScript中複製以下內容? 我想在同一頁面中有兩個下拉菜單。Javascript - 查找並複製下拉列表
<fieldset id="product-options-wrapper" class="product-options">
<dl class="last">
<dt>
<label class="required">
<em>*</em>
Pack Size/Price
</label>
</dt>
<dd class="last">
<div class="input-box">
<select id="attribute148" class="required-entry super-attribute-select" name="super_attribute[148]" onchange="return changeSku(148, this);">
<option value="">Choose an Option...</option>
<option value="76">10g: €9.60</option>
<option value="61">25g: €17.40</option>
<option value="78">100g: €43.80</option>
</select>
</div>
</dd>
</dl>
謝謝
使用https://api.jquery.com/clone/ – rahulsm
爲什麼要在一頁中選擇2個相同的選項?使用'.find()'與'.clone()' – guradio
另外,刪除id並僅使用class或爲克隆的元素設置不同的id。 –