Last Updated : 12 Aug, 2022
The HTML <input> list Attribute is used to identify a list of pre-defined options for an element to suggest the user.
Syntax:
<input list="datalist_id">
Attribute Values:
Example:
html
<!DOCTYPE html>
<html>
<head>
<title>
HTML Input list Attribute
</title>
</head>
<body>
<h1>
GeeksForGeeks
</h1>
<h1 style="color:green">
HTML Input list Attribute
</h1>
<form action="">
<label>Your Cars Name: </label>
<input list="cars">
<datalist id="cars">
<option value="BMW" />
<option value="Bentley" />
<option value="Mercedes" />
<option value="Audi" />
<option value="Volkswagen" />
</datalist>
</form>
</body>
</html>
Output:
Supported Browsers: The browsers supported by HTML <input> list Attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4