Tuesday, April 15, 2014

Datalist in HTML5

Syntax

The <datalist> is new tag introduced in HTML5.
The <datalist> tag is used to create an autocomplete feature for form input fields in websites.

Using <option> tag shows suggestion for users,when they start typing in input elements.



HTML Code

<div class="wrapContainer">
  <div class="codeContainer">
    <p class="Blue">
    <form action="#" method="get">
      <input list="languages" name="languages">
      <datalist id="languages">
        <option value="Java"></option>
        <option value="PHP"></option>
        <option value="HTML5"></option>
        <option value="Joomla"></option>
        <option value="Wordpress"> </option>
      </datalist>
      <input type="submit" value="Submit">
    </form>
    </p>
  </div>
</div>


Demo

No comments:

Post a Comment