HTML <input> with list Attribute
HTML <input> with list Attribute
The list
attribute provides pre-defined options to suggest to the user.
Note: The value of the list
attribute should be same as the value of the id
attribute of the <datalist> element which holds the list of options to suggest to the user.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<form action="/fruits.php">
<input list="fruits" name="myFruit">
<datalist id="fruits">
<option value="Apple">
<option value="Mango">
<option value="Orange">
</datalist>
<input type="submit">
</form>
</body>
</html>
Attribute Value
Value | Explanation |
---|---|
datalist_id | Specifies the id of the <datalist> element which holds the list of options to suggest to the user. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.