My error not getting resolve

<label>How did you hear about us?
        <select>
        <option></option>
        <option></option>
        <option></option>
        <option></option>
        <option></option>
       </select>
      </label>

Test

Sorry, your code does not pass. Try again.

Hint

You should nest only the select element within a label element.

How did you hear about us?

// here is the code

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key.

Also, please let us know what course and step this is for. It is best to just give us a link to the step.

Learn HTML Forms by Building a Registration Form: Step 30 | freeCodeCamp.org

im doing responsive design(HTML)

Can you paste your HTML in here again using the triple back tick method I explained above?

It is much better to paste your code in here than to use a pic. Is there a reason you can’t do the back tick method?

But I am able to see your issue from the pic. You want to nest the entire select in the label. You are only nesting the label text in the label.

<fieldset>
        <label>Upload a profile picture: <input type="file" /></label>
        <label>Input your age (years): <input type="number" min="13" max="120" />
			  <label>How did you hear about us?</label>
          <select>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          </select> 
      </fieldset>
 <label>How did you hear about us?
          <select>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          </select> 
        </label>

im even nesting the whole select element within label but still it is saying Sorry, your code does not pass. Keep trying.

Hint

You should nest only the select element within a label element.

Step 30

Nest the select element within a label element with the text How did you hear about us?. The text should come before the select element.

@bbsmooth whats the error?

This looks correct to me. If you still can’t get this step to pass then please paste all of your HTML in here because there is a chance you accidentally changed something else that is causing the test to fail.

@bbsmooth i checked the whole code it looks perfect but still pls check it for me, so may I continue further

<!DOCTYPE html>
<html>
  <head>
    <title>Registration Form</title>
	  <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label>Enter Your First Name: <input type="text" required /></label>
        <label>Enter Your Last Name: <input type="text" required /></label>
        <label>Enter Your Email: <input type="email" required /></label>
        <label>Create a New Password: <input type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <label><input type="radio" name="account-type" /> Personal Account</label>
        <label><input type="radio" name="account-type" /> Business Account</label>
        <label>
          <input type="checkbox" required /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
			  </label>
      </fieldset>
      <fieldset>
        <label>Upload a profile picture: <input type="file" /></label>
        <label>Input your age (years): <input type="number" min="13" max="120" />
<label>
  How did you hear about us? 
          <select></select>
</label>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          

			  
      </fieldset>
       
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

Hello. The problem seems to be you’re forgetting the space before the text. If you pay close attention, in the hint they ask you to type the text ’ How did you hear about us?'.

Your initial code was correct, as far as I can tell. That was the only issue with it.

1 Like

There is no space required before the label text, that is fine. The problem is that you accidentally removed the closing </label> tag on the “Input your age” input just above the select. If you add that then it will pass, but it actually shouldn’t because you also have a problem with the select.

<label>
  How did you hear about us? 
          <select></select>
</label>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          <option></option>

The options should be inside the select tags. I think you found a bug in the tests :slight_smile:

1 Like

You’re right, I checked again and indeed the space is not necessary.