Listing down various options for input values in HTML5


The HTML <datalist> tag specifies set of options for <input> element. You can try to run the following code to list options for input values in HTML5 −

Example

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Datalist Tag</title>
   </head>
   <body>
      <input list = "tutorials" />

      <datalist id = "tutorials">
         <option value = "Java">
         <option value = "ASP">
         <option value = "PHP">
         <option value = "Ruby">
         <option value = "jQuery">
      </datalist>

      <p>Try to add any of the tutorial name mentioned above.</p>
   </body>
</html>

Updated on: 24-Jun-2020

89 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements