Failed HTML/CSS Assessment: Clarification on Feedback

Learning Challenge

HTML/CSS Assessment 10/12

Question

Here are the questions I got wrong:

  • has exactly one input with a name of ‘pet_name’ and an associated label with the content ‘Name’

  • has exactly one ‘select’ element with a name of ‘pet_type’ and an associated label with the content ‘Type’

Is it the “id” element I got wrong in my code for both of the above? I will include a screenshot of what I mean.

What I’ve tried

I want to replace the id=“name” with id=“pet_name” for the first problem to fix it…?

I want to replace the id=“type” with id=“pet_type” for the second problem to fix it…?

Screenshots

image

You’ll want to leave the (1) the way it is. That one is correct.

You’ll want to change the for attribute on the label for the Type. The value in the for attribute should be the id attribute of the element that you want it to be “associated” with …

In real world terms, if you click on the label text in the browser … the browser will then put your cursor into the associated input.

Hopefully that helps!

Hello @bryanray. Thank you for your reply thus far. So am I correct in assuming that I’m not focusing on the right code for the first mistake they said I made?

Blockquote
i.e. has exactly one input with a name of ‘pet_name’ and an associated label with the content ‘Name’

Or in the first one with the select element, do I change the for attribute from “name” to “pet_name” or some variation of that?

I’ve edited this a thousand times, but I think I know what you mean for the second one and now I feel stupid. So for the second one I’m assuming in the for attribute I replace “name” with “type”…
That would be the element associated with the id attribute “type”…Yes or No?

That is correct!. :+1:

1 Like