对于input
元素,我们可以将datalist
元素用作自动完成
<input name="account" placeholder="account" list="publisher">
<datalist id="publisher">
<option value="00000" >00000</option>
<option value="00001" >00001</option>
<option value="00002">00002</option>
</datalist>
有select
元素的方法吗?不自动完成只需用选项填充选项,例如:
the two example should be equivalent
<select name=account>
<option value="00000" >00000</option>
<option value="00001" >00001</option>
<option value="00002">00002</option>
</select>
and that
<select name="account" list="publisher"></select>