gengns ES

An entry from the gengns log, written by Génesis García Morilla · · HTML5

Autocomplete dropdown

Have you ever used autocomplete dropdowns from jQuery UI or Bootstrap third party options? A complete heavyweight mess.

Luckly, we got a couple of years ago an awaited solution: Native HTML5 Autocomplete dropdown with datalist. A lightweight standard supported in all devices.

HTML

<input list="series">
<datalist id="series">
  <option value="Adventure Time">
  <option value="Cosmos">
  <option value="Rick and Morty">
  <option value="Game of Thrones">
  <option value="Planet Earth 2">
  <option value="Black Mirror">
</datalist>
Open in JSFiddle

Save your tooling time, use as few libraries and frameworks as possible!

Tags: autocomplete, dropdown