

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use list attribute in HTML?
In HTML, we use the <datalist> element to specify a list of pre-defined options. This list is for an input element. The list attribute refers to this <datalist> element. HTML5 introduced the list attribute.
The list attribute refers to a <datalist> element that contains pre-defined options for an <input> element.
Example
You can try to run the following code to learn how to use the list attribute in HTML.
<!DOCTYPE html> <html> <head> <title>HTML list attribute</title> </head> <body> <p>Type the tool name:</p> <input list = "tools" name = ”tool” /> <datalist id = "tools"> <option value = "Image Editor"> <option value = "Whiteboard"> <option value = "Image Optimizer"> <option value = "Document Viewer"> </datalist> </body> </html>
- Related Questions & Answers
- HTML list Attribute
- How to use autocomplete attribute in HTML?
- How to use formnovalidate attribute in HTML?
- How to use formaction attribute in HTML?
- How to use formenctype attribute in HTML?
- How to use formtarget attribute in HTML?
- How to use multiple attribute in HTML?
- How to use pattern attribute in HTML?
- How to use placeholder attribute in HTML?
- How to use step attribute in HTML?
- How to use href attribute in HTML Page?
- How to use a novalidate attribute in HTML?
- How to use the formmethod attribute in HTML?
- How to use the required attribute in HTML?
- How to use image height and width attribute in HTML Page?
Advertisements