Auto-complete

The datalist tag specifies a list of pre-defined options for an input element.

Example

Usage

<label for="city">City</label>
<input type="text" id="city" name="city" list="suggestions" />
<datalist id="suggestions">
   <!--[if lte IE 9]><select><![endif]-->
   <option label="Barrie" value="Barrie"></option>
   <option label="Calgary" value="Calgary"></option>
   <option label="Charlottetown" value="Charlottetown"></option>
   <option label="Chibougamau" value="Chibougamau"></option>
   <option label="Chilliwack" value="Chilliwack"></option>
   <option label="Cold Lake" value="Cold Lake"></option>
   <option label="Dorval" value="Dorval"></option>
   <option label="Edmonton" value="Edmonton"></option>
   <option label="Flin Flon" value="Flin Flon"></option>
   <option label="Hamilton" value="Hamilton"></option>
   <option label="Iqualuit" value="Iqualuit"></option>
   <option label="Ottawa" value="Ottawa"></option>
   <option label="Miramichi" value="Miramichi"></option>
   <option label="Montreal" value="Montreal"></option>
   <option label="Red Deer" value="Red Deer"></option>
   <option label="St. John" value="St. John"></option>
   <option label="St. John's" value="St. John's"></option>
   <option label="Toronto" value="Toronto"></option>
   <option label="Vancouver" value="Vancouver"></option>
   <option label="Whitehorse" value="Whitehorse"></option>
   <option label="Winnipeg" value="Winnipeg"></option>
   <option label="Yellowknife" value="Yellowknife"></option>
   <!--[if lte IE 9]></select><![endif]-->
</datalist>