1D0-720 · Question #96
What is the function of the HTML5 <datalist> element?
The correct answer is A. It creates a dropdown list of predefined options. Option A is correct because <datalist> works alongside an <input> element (via the list attribute) to offer users a set of predefined suggestions they can select or ignore while still typing freely - functioning as an autocomplete dropdown. Option B is wrong because file…
Question
What is the function of the HTML5 <datalist> element?
Options
- AIt creates a dropdown list of predefined options.
- BIt provides a file upload mechanism.
- CIt generates a list of radio buttons.
- DIt is used for styling forms.
How the community answered
(29 responses)- A86% (25)
- B3% (1)
- C7% (2)
- D3% (1)
Explanation
Option A is correct because <datalist> works alongside an <input> element (via the list attribute) to offer users a set of predefined suggestions they can select or ignore while still typing freely - functioning as an autocomplete dropdown. Option B is wrong because file uploads are handled by <input type="file">, not <datalist>. Option C is incorrect since radio buttons are created with <input type="radio"> grouped by a shared name attribute. Option D is a red herring - styling forms is the job of CSS, not an HTML structural element.
Memory tip: Think of <datalist> as a data list - it holds a list of data suggestions for an input field. The pairing <input list="id"> + <datalist id="id"> is the key pattern to remember: one provides the box, the other provides the options.
Topics
Community Discussion
No community discussion yet for this question.