Advertisement
❮ Previous: <data> Next: <dd> ❯

<datalist>

HTML <datalist> Tag

Example

<label for="browser">Select the browser:</label>
<input list="browsers" name="browser" id="browser">
<datalist id="browsers">
  <option value="Edge">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
  <option value="Samsung">
</datalist>

Try this code ❯

Meaning

The <datalist> element contains pre defined options for an <input> element.

These listed items would be considered the quick choices for the field, not a limitation of what can be entered.

Version: HTML5


Standard Syntax

<input list="identifier">
<datalist id="identifier">
	<option value="text">
</datalist>

The dropdown menu containing available options does not appear in Opera for Android.


Advertisement

Attributes

Attribute Value Description
id identifier Unique in the whole document.(connect with input element)

Global Attributes

The <datalist> element also supports the Global Attributes in HTML.


Event Attributes

The <datalist> element also supports the Event Attributes in HTML.


By Default CSS Value(s)

Most of the browsers will display the <details> element with the following by default value(s)

datalist {
  display: none;
}
❮ Previous: <data> Next: <dd> ❯
Advertisement