我試圖讓兩個「<select>
單一水果」元素獲得一個<datalist>
元素列表。HTML5:如何爲一個datalist獲取多個select元素?
由於HTML:
Select one fruit: <select type="text" name="fruit1" list="fruits"></select>
Select a second fruit: <select type="text" name="fruit2" list="fruits"></select>
<datalist id="fruits">
<option value="Blackberry">Blackberry</option>
<option value="Blackcurrant">Blackcurrant</option>
<option value="Blueberry">Blueberry</option>
<!-- … -->
</datalist>
的第二<select>
break my code (fiddle demo)列入。 如何處理它們以使它們在同一數據列表(或相似的值列表)上工作。
編輯:<select />
修正爲<select></select>
(@richard)
[與數據列表多選](HTTP的可能重複: //stackoverflow.com/questions/14148538/multiple-selections-with-datalist) –