Welcome to Bucaro TecHelp!

Bucaro TecHelp
HTTPS Encryption not required because no account numbers or
personal information is ever requested or accepted by this site

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Use Datalist Tag to Specify Pre-defined Text for Input Element

The HTML5 <datalist> element allows the designer to provide a list of suggested values for a text input box. If the user doesn't like any of the items in the list, they can still type their own text into the text box. Example code for a datalist is shown below.

<datalist id="autobrand">
  <option value="Fiat-Chrysler">
  <option value="Ford Motor Company">
  <option value="General Motors">
  <option value="Tesla Motors">
  <option value="Toyota Motor Company">
</datalist>

<label for="autobrand">Auto Brand <input type="text" list="autobrand" name="autobrand"></label>

Use the list attribute in the <input> element to associate it with the id of its respective datalist.

Note the datalist is similar to the select list, except the select list does not allow the user to enter a value not in the list.

More HTML Code:
• Radio Button Basics
• Meta Tag Basics
• Set Form Controls Tab Order With tabindex Attribute
• Creating a Subscript or Superscript with HTML
• HTML Image Basics
• Use Datalist Tag to Specify Pre-defined Text for Input Element
• HTML DIV Basics
• HTML abbr and acronym Tag
• The HTML BODY tag
• HTML5 role Attribute

Follow Stephen Bucaro Follow @Stephen Bucaro

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2022 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268