Skip to content
The HTML Herbarium

/static/herbario/gamer/en/especime/datalist/

Menu

HTM-021 · Forms

<datalist>

Suggestions for a field that still accepts anything.

Linked to an <input> through the list attribute, it turns the field into autocomplete without a line of script. Unlike <select>, it restricts nothing: the options are a shortcut, not a closed list.

The price of that freedom is the appearance. The list is drawn by the browser and barely accepts CSS.

<label for="busca">Specimen</label>
<input id="busca" name="q" list="especimes">

<datalist id="especimes">
  <option value="details">
  <option value="dialog">
  <option value="meter">
</datalist>
{esc(legenda)}

Living specimen · start typing "d" and the browser suggests