Learn html forms by building registration form - step 17

I cannot seem to get this one. Here are a few different ways I have tired:

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

This is what I keep getting:
Hint The first label element should have a for attribute with a value of first-name.

If I take out the id=“first-name” then I get Hint The first input element should have an id of first-name.

Hi,
You should have ‘for’ for all label elements in every fieldset and that value must be the same for all corresponding input ‘id’ and ‘name’ attributes. Code won’t pass until you enter the same value for: ‘for’ (label element), ‘id’ (input element), ‘name’ (input element). Your code also misses ‘type’ attribute and ‘required’ (you cannot submit an empty form).

1 Like

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