-2
選擇上的「其他」點擊選擇「其他」,輸入框應該會出現,其價值將被追加到作爲添加一個新的選項中的jQuery
添加新的選項後,「其他」仍應在下拉列表中。如何實現這一目標?
<select class="form-control" id="category" name="category">
<option>Notification</option>
<option>Other</option>
</select>
輸入框:
<input type="text" value="">
在添加值 「警報」 作爲一個選項,這應該是結構,
<select class="form-control" id="category" name="category">
<option>Notification</option>
<option>Alert</option>
<option>Other</option>
</select>
什麼代碼,你寫的完成這個任務?目前這個問題更多的是'爲我寫'我的代碼'的請求,可能會被低估和/或關閉 –