Skip to content
Could not find version "repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches "

Use datalist for auto completion

zcbenz edited this page · 1 revision
Clone this wiki locally
Clone in Desktop

The Datalist element is used to suggest input values to the user, thereby providing an "autocomplete" feature on form elements. This is especially useful for long lists, such as countries or clothing manufacturers. Rather than scan through the entire list, the input control can suggest some items as soon as the user has typed in some characters. Thus, it behaves as a sort of combobox, possessing both a textbox and list component. Here is how it would appear:

<input type="text" value="" list="fruits" />
<datalist id="fruits">
  <option value="Apple"></option> 
  <option value="Orange"></option> 
  <option value="Peach"></option> 
</datalist>

For more demos you can have a look at http://demo.agektmr.com/datalist/.

Something went wrong with that request. Please try again.