Which HTML element provides a predefined list of options for an input element?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

Which HTML element provides a predefined list of options for an input element?

Providing a predefined set of options for an input field is done with a datalist. The input connects to a datalist by using the list attribute and the datalist contains option elements that define the possible suggestions. When the user types, the browser can show those suggestions, but the user isn’t forced to pick one and can still enter a value outside the list. This approach contrasts with a select, which is a separate control that presents a dropdown of options and requires choosing one from that list. The option element itself is the item inside either a datalist or a select; by itself it isn’t the mechanism that attaches a list to an input.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy