0
我想用2個下拉菜單製作一個貝寶項目。我想讓第一個下拉菜單根據選擇改變第二個下拉菜單。我應該如何去做這件事?我嘗試在第一個菜單上使用onchange,第二個使用.innerHtml。更改下拉菜單上的內容
<tr><td><input type="hidden" name="on0" value="Year">Year</td></tr><tr><td><select name="os0">
<option value="None">None </option><!-- Show list 1 -->
<option value="2015">2015 </option><!-- replace list 1 with list 2 -->
<option value="2016">2016 </option><!-- replace list 1 with list 2 -->
<option value="2017">2017 </option><!-- replace list 1 with list 2 -->
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Size">Size</td></tr><tr><td><select name="os1">
<!-- List 1 -->
<option value="Youth X-Small">Youth X-Small </option>
<option value="Youth Medium">Youth Medium </option>
<option value="Youth Large">Youth Large </option>
<option value="Youth X-Large">Youth X-Large </option>
<option value="Adult Small">Adult Small </option>
<option value="Adult Medium">Adult Medium </option>
<option value="Adult Large">Adult Large </option>
<option value="Adult X-Large">Adult X-Large </option>
<option value="Adult XX-Large">Adult XX-Large </option>
</select> </td></tr>
<!-- List 2 -->
<option value="Youth Large">Youth Large</option>
<option value="Youth X-Large">Youth X-Large</option>
<option value="Adult Small">Adult Small</option>
<option value="Adult Medium">Adult Medium</option>
<option value="Adult Large">Adult Large</option>
<option value="Adult X-Large">Adult X-Large</option>
<option value="Adult XX-Large">Adult XX-Large</option>
你想要什麼到底是什麼? –
是的懂了..使用jQuery的onchange函數 –