Learn HTML Forms by Building a Registration Form - Step 39

When i use "Check Your Code (CTRL + Enter) I get the “Sorry your code does not pass”. I don’t know what to do, i’ve even tried using chatgpt which says that i’m doing the right thing. The error i get is The first input element should have an id of profile-picture .
This is my code:

    <fieldset>
      <label id="profile-picture">Upload a profile picture: <input type="file" /></label>
      <label>Input your age (years): <input type="number" min="13" max="120" /></label>
      <label>How did you hear about us?
        <select>
          <option value="">(select one)</option>
          <option value="1">freeCodeCamp News</option>
          <option value="2">freeCodeCamp YouTube Channel</option>
          <option value="3">freeCodeCamp Forum</option>
          <option value="4">Other</option>
        </select>
      </label>
      <label>Provide a bio:
        <textarea></textarea>
      </label>
    </fieldset>

Hi! Don’t worry this part is tricky for everyone.
You should put the id inside the input and not the label.
Inside the label you should use the for attribute with the value of the following id to link them together.
It should come out like this:

<fieldset>
        <label for='profile-picture'>Upload a profile picture: <input type="file" id='profile-picture'/></label>
        <label for='age'>Input your age (years): <input type="number" min="13" max="120" id='age'/></label>
        <label for='referrer'>How did you hear about us?
          <select id='referrer'>
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label for='bio'>Provide a bio:
          <textarea id='bio'></textarea>
        </label>
      </fieldset>
2 Likes

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