<datalist>

The <datalist> element represents a set of <option> elements that represent predefined options for other controls. In the browser's rendering, the <datalist> element alone represents nothing.

Browser Support for <datalist>

Note: The following information about browser support is from the MDN Web Docs HTML Elements Reference.

Default Browser Behavior

Content within a <datalist> element will not be be rendered by the browser, unless it is bound to an <input> element.

When a <datalist> element is bound to an <input> element, the browser will render a combobox that will be able to receive keyboard focus.

To operate the combobox, a user can:

Usage Notes

To bind a <datalist> element with a <input> element, the <datalist> must have an id attribute whose value is identical to the list attribute of the <input> element.

Examples

Note: Use your browser's View Source function to view the source code of the following examples.

<datalist> element alone

Note: As mentioned previously, content within a <datalist> element will not be be rendered by the browser, unless it is bound to an <input> element.

<datalist> element bound to an <input> element