TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML datalist tag

HTML datalist tag with examples, html5, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML Datalist Tag

The HTML <datalist> tag is is used to provide an auto complete feature on form element. It provides a list of predefined options to the users to select data.

The datalist tag is introduced in HTML5.

The <datalist> tag should be used with an <input< element that contains a "list" attribute. The value of "list" attribute is linked with the datalist id.

The HTML datalist tag supports global and event attributes also.


HTML datalist tag example

Let's see the simple example of HTML5 datalist tag. If you press A, it will show a list of cricketers starting with A letter.

<label>
 Enter your favorite cricket player: Press any character<br />
 <input type="text" id="favCktPlayer" list="CktPlayers">
 <datalist id="CktPlayers">
 <option value="Sachin Tendulkar">
 <option value="Brian Lara">
 <option value="Jacques Kallis"> 
 <option value="Ricky Ponting"> 
 <option value="Rahul Dravid"> 
 <option value="Shane Warne"> 
 <option value="Rohit Sharma"> 
 <option value="Donald Bradman"> 
 <option value="Saurav Ganguly "> 
 <option value="AB diVilliers"> 
 <option value="Mahendra Singh Dhoni"> 
 <option value="Adam Gilchrist">
 </datalist>
</label>
Test it Now

Output:


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<datalist>YesYesYesYesYes




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf