in HTML, you do this backwards: You define a text input:
<input type="text" list="browsers" />
and attach a datalist to it. (note the list attribute of the input).
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>