The <datalist> tag creates a list of options for an <input> element to provide an "autocomplete" feature.
We can can bind datalist
with input
with list
attribute from <input>.
<datalist> |
Yes | Yes | 10.0 | No | Yes |
The <datalist> tag is new in HTML5.
The <datalist> tag supports the Global Attributes in HTML.
The <datalist> tag supports the Event Attributes in HTML.
datalist { display: none; }
<!DOCTYPE html>
<html>
<body>
<!-- w w w .j ava 2 s .c om-->
<form action="" method="get">
<input list="myList" name="myInput">
<datalist id="myList">
<option value="A">
<option value="B">
<option value="C">
<option value="D">
<option value="E">
</datalist>
<input type="submit">
</form>
</body>
</html>