How to refer to a <datalist> element that contains pre-defined options for an <input> element in HTML?

HTMLWeb DevelopmentFront End Technology

Use the list attribute for <datalist> element that contains pre-defined options for an <input> element in HTML. You can try to run the following code to implement the list attribute −

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>
raja
Published on 14-Mar-2018 08:19:35
Advertisements