Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to input text in HTML Select Tag?

I want to make input option in select tag so user can choose between options or insert different value.
Is it possible?

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
  **<insert user value>**
</select>
like image 761
user1455966 Avatar asked Mar 19 '13 17:03

user1455966


1 Answers

HTML solution with "list" attribute:

<input type="text" name="city" list="citynames">
<datalist id="citynames">
  <option value="Boston">
  <option value="Cambridge">
</datalist>
like image 197
Vildan Avatar answered Sep 18 '22 19:09

Vildan