Learn HTML Forms by Building a Registration Form - Step 18

Tell us what’s happening:

I don’t know what I am typing incorrectly because the task says to " Use first-name , last-name , email , and new-password as values for the respective id attributes."

But when I try to check the code it says " The first label element should have a for attribute with a value of `first-name".

Your code so far

 <fieldset>
        <label>Enter Your First Name: <input id="first-name" for="first-name"/></label>
        <label>Enter Your Last Name: <input id="last-name" for="last-name"/></label>
        <label>Enter Your Email: <input id="email" for="email"/></label>
        <label>Create a New Password: <input id="new-password" for="new-password"/></label>
      </fieldset>

Your browser information:

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

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 18

Welcome to the forum @zaydaaziz17

The instructions do ask you to add a for attribute for the label element, to associate it with the respective input element.

Happy coding

Do a search for fieldset and you will find the label and the attributes. You’ll see where the “for” goes.

1 Like