Build a Survey Form - Instruction 10

Hello everyone -
Apologies in advance if this sounds dumb or if it has been answered elsewhere, but I couldn’t find previous answers to my question, and my brain is very literally oriented.

I am not having trouble with any line of code specifically, rather I have a question on the 10th instruction for this project. It states:

  1. For the name, email, and number input fields, you can see corresponding label elements in the form, that describe the purpose of each field with the following ids: id=“name-label”, id=“email-label”, and id=“number-label”

My understanding from the lessons was that the label elements ( as in label for=“” ) should be named the same as the input id/name. So is this just telling that all of those (including the label=“for”) should have those specific names?

Thanks

Ryan
Your code so far

<!-- file: index.html -->

/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

I think this user story is just telling you two things:

  • The name, email, and number input fields must have labels (via the label element)
  • These inputs should have the ids name-label, email-label, and number-label.

If you nest the input inside of the label then technically you don’t need to use the for attribute on the label (although it is a best practice to add it anyway). But if the input is not nested inside the label then you definitely need the for attribute on the label.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.