Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <datalist> tags


May 04, 2021 HTML Reference Manual


Table of contents


HTML .lt;datalist.gt; tags

The label needs to be used in conjunction with the label to represent an optional list.

The following is a possible value for the element, which is described in the .lt;input>

<input list="browsers">

<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>

Try it out . . .

Browser support

HTML <datalist> tags HTML <datalist> tags HTML <datalist> tags HTML <datalist> tags HTML <datalist> tags

IE 10, Firefox, Opera, and Chrome support the hashtags.

Note: IE 9 and earlier versions of IE browsers, as well as Safari, do not support the hashtags.


Label definition and instructions for use

The label specifies a list of possible options for the element.

The label is used to provide "auto-completion" features for the element. The user can see a down-and-down list where the options are predefined and will be used as input data for the user.

Please use the list property of the element to bind the element to the element.

Tip: You cannot control the location of datalist and cannot bind it to the data of the server.


The difference between HTML 4.01 and HTML5

The label is the new label in HTML5.


Global properties

The label supports the global properties of HTML.


The event property

The tag supports the event properties of HTML.


Related articles

HTML DOM Datalist object