HTML Survey Form Project User Story 12

Hi all, User Story #12 is giving me fits on this project and I just don’t understand what I’m doing wrong. It is asking for a select element with an id of dropdown, and I have that! Everything else is fine and this is the only HTML piece that hasn’t been worked out yet, although I still have to style it. Thanks in advance for the help.

Here’s the code so far:

<label for="dropdown" id="dropdown" name="dropdown">How many cups of coffee do you drink per day?

</label>

<select id="dropdown">
    <option value="">(Select one)</option>
    <option value="1">1-3</option>
    <option value="2">4-6</option>
    option value="3">7+</option>
</select>

When I run tests on it, the only error message that I get is:

//running tests
You should have a select field with an id of “dropdown”
//tests completed

the select element should be nested inside the label opening and closing elements.

Hey, thanks for the reply - however, that was my first thought as well! But it still turns up the same error message. Here’s the new code, getting the same error message - maybe I’m misunderstanding what you’re saying.

<label for="dropdown" id="dropdown" name="dropdown">How many cups of coffee do you drink per day?


<select id="dropdown">
    <option value="">(Select one)</option>
    <option value="1">1-3</option>
    <option value="2">4-6</option>
    option value="3">7+</option>
</select>

</label>

The label element does not require an id. It just needs the “for” property which refers to the “id” of the select element.

1 Like

Ahh!! Thank you so much!!