Before datalist
(see note below), you would supply an additional input
element for people to type in their own option.
<select name="example">
<option value="A">A</option>
<option value="B">B</option>
<option value="-">Other</option>
</select>
<input type="text" name="other">
_x000D_
This mechanism works in all browsers and requires no JavaScript.
You could use a little JavaScript to be clever about only showing the input
if the "Other" option was selected.
The datalist
element is intended to provide a better mechanism for this concept. In some browsers, e.g. iOS Safari < 12.2, this was not supported or the implementation had issues. Check the Can I Use page to see current datalist support.
<input type="text" name="example" list="exampleList">
<datalist id="exampleList">
<option value="A">
<option value="B">
</datalist>
_x000D_