How to use the datalist tag in HTML?

 How to use the <datalist> tag in HTML?


The HTML <datalist> tag specifies a set of options for

 <input> element. 

You need to also add an id.

 Use the <option>…<option> tag inside the

 <datalist…</datalist> tag.



How to write or use < datalist> tag in html 


<html>

   <head>

      <title>HTML Datalist Tag</title>

   </head>


   <body>

      <p>Type the tool name:</p>

      <input list = "tools" />

      <datalist id = "tools">

         <option value = "Image Editor">

         <option value = "Whiteboard">

         <option value = "Image Optimizer">

         <option value = "Document Viewer">

      </datalist>

   </body>

</html>

Comments

Last 7 Days

How to use referrerpolicy Attribute value ( no-referrer-when-downgrade ) with < iframe > tag in HTML ? with example

Syntax of writing a different font style in HTML

How to use sandbox attribute value ( allow-top-navigation) with < iframe > tag in HTML ? with example

What is < table > tag in HTML?

css for code blocks