Horje

Full Example of HTML <datalist> Element

The datalist element specifies a list of pre-defined options for an input element.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>The datalist Element</h2>

<p>The datalist element specifies a list of pre-defined options for an input element.</p>

<form action="/action_page.php">
  <input list="browsers" name="browser">
  <datalist id="browsers">
    <option value="Edge">
    <option value="Firefox">
    <option value="Chrome">
    <option value="Opera">
    <option value="Safari">
  </datalist>
  <input type="submit">
</form>

</body>
</html>

Output should be:

Full Example of HTML <datalist> Element



Related Articles
What is HTML Form Elements HTML Form Elements
How to create HTML <input> Element HTML Form Elements
How to create The <label> Element HTML Form Elements
How to create HTML <select> Element HTML Form Elements
How to create HTML <option> element HTML Form Elements
How to Visible HTML Select Option Values HTML Form Elements
How to Allow Multiple Selection in HTML Option Value HTML Form Elements
How to create HTML <textarea> Element HTML Form Elements
How to create HTML <button> Element HTML Form Elements
How to create HTML <fieldset> and <legend> Elements HTML Form Elements
How to create HTML <datalist> Element HTML Form Elements
How to create HTML <output> Element HTML Form Elements


Type:
Html
Category:
Web Tutorial
Sub Category:
HTML Form Elements
Uploaded by:
Admin



Share on: