datalist element

<datalist>

Explanation

Datalist element encloses the entire <option>.
<input list="Text" name="Text" /> <datalist id="Text"> <option value="Text"> </datalist> <input type="submit"/>

Example Code:

Result :

Enter a celebrity name:

  • <input> must be included with the <datalist>.
  • When user enters value in the text box, then the options are automatically filled.
It is newly introduced in HTML5 and it is not available in previous versions of HTML.
It supports both Global Attributes and Event Attributes in HTML5.

Limitations:

It will function only in Opera and Firefox browsers.

Ask Questions

Ask Question