Filter (Advanced Search)
Downloads
0
Views
235
Video

Video is not available... Embedded is previous playlist.

Details

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

Users will see a drop-down list of the pre-defined options as they input data.

The list attribute of the <input> element, must refer to the id attribute of the <datalist> element.


<!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="/php/dataList.php" method="post">
  <input list="languages" name="language">
  <datalist id="languages">
    <option value="HTML">
    <option value="C">
    <option value="C++">
    <option value="Java">
    <option value="Python">
  </datalist>
  <input type="submit">
</form>

<p><b>Note:</b> The datalist tag is not supported in Safari prior version 12.1.</p>

</body>
</html>



Ad