input list Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Description

The list attribute refers to a <datalist> element that contains pre-defined options for an <input> element.

Attribute Values

Value Description
datalist_id Specifies the id of the datalist to bind the <input> element to

An <input> element with pre-defined values in a <datalist>:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="get">
  <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>
  <input type="submit">
</form><!--   www .  j ava2  s  .  com-->

</body>
</html>

Related Tutorials