Wednesday, September 10, 2014

HTML5: datalist tag - an "autocomplete" feature for input field

From w3school.com:
The <datalist> tag specifies a list of pre-defined options for an <input> element.
The <datalist> tag is used to provide an "autocomplete" feature on <input> elements. Users will see a drop-down list of pre-defined options as they input data.
Use the <input> element's list attribute to bind it together with a <datalist> element
The <datagrid> tag should be avoided in any HTML code because it has been dropped from the HTML specification (or at least deferred)


<input list="browsers" name="browser">
<datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist>

No comments:

Post a Comment