uCertify CIW Advanced HTML5 & CSS3 Specialist Practice Test 2026 – Your All-in-One Guide to Exam Excellence!

Session length

1 / 20

Which two HTML attributes must match to bind a datalist to its input?

The name attribute and the value attribute

The id attribute and the for attribute

The list attribute and the id attribute

Binding a datalist to an input relies on a direct reference between the two elements. The input carries a list attribute, and that attribute’s value must be the id of the datalist. This exact matching tells the browser which list of options to show as you type. The datalist’s id provides the unique identifier for that list, and the input’s list value points to it. When they match, the input will present the predefined options from that datalist as suggestions.

For example, the input might look like: <input type="text" list="cityList"> and the datalist would be: <datalist id="cityList"> ... </datalist>. The name, value, or type attributes are unrelated to binding the datalist, and the for attribute is used with labels, not for linking datalists.

The type attribute and the list attribute

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy