0 votes
99 views
in HTML by (3.5k points)
edited

What is datalist tag?

1 Answer

0 votes
by (3.5k points)
edited
The datalist tag is an HTML tag that lets the user auto-complete the form based on the predefined options. It presents the users with predefined options that they can choose from. An example of this can be as below:

<label>    

 Enter your favorite Bollywood Actor: Press any character<br />    

 <input type=&rdquo;text&rdquo; id=&rdquo;favBolActor&rdquo; list=&rdquo;BolActors&rdquo;>    

 <datalist id=&rdquo;BolActor&rdquo;>    

 <option value=&rdquo;Shahrukh Khan&rdquo;>    

 <option value=&rdquo;Akshay Kumar&rdquo;>    

 <option value=&rdquo;Aamir Khan&rdquo;>     

 <option value=&rdquo;Saif Ali Khan&rdquo;>     

 <option value=&rdquo;Ranbir Kapoor&rdquo;>     

 <option value=&rdquo;Ranveer Singh&rdquo;>     

 <option value=&rdquo;Sanjay Dutt&rdquo;>     

 <option value=&rdquo;Hrithik Roshan&rdquo;>     

 <option value=&rdquo;Varun Dhawan&rdquo;>     

 <option value=&rdquo;Ajay Devgan&rdquo;>    

 </datalist>    

</label>

Related questions

0 votes
1 answer 135 views
0 votes
1 answer 142 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 118 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 135 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 102 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 95 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

563 users

...