Survey Form - Build a Survey Form

Tell us what’s happening:
I don’t know why I get the following errors?

  • You should have a label element with an id of name-label.

  • Failed:You should have a label element with an id of email-label.

  • Failed:You should have a label element with an id of number-label.

Your code so far

please help me.

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>freeCodeCamp Survey Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1 id="title">Delta Gym</h1>
    <p id="description">Thank you for taking the time to help us improve the gym</p>
    <form id="survey-form">
      <fieldset> 
      <label for="name">Enter Your First Name: <input id="name" name="name" type="text" required /></label>
      <label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
      <label for="number">Age of the user: <input id="number" name="number" type="number" required min=10 max=100 /></label>
</fieldset> 
    </form>

/* file: styles.css */
body {
  background-color: black;
  color: white;
  font-family: arial;
  font-size: 16px;
  }
h1, p {
  margin: 1em auto;
  text-align: center;
} 
label {
  display: block;
  margin: 0.5rem 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

Do you have a label element with the id of “name-label”? You only have three labels in your HTML, so it should be fairly easy to determine if any of them have an id of “name-label”.

I’ve identified the problem, I should have put an extra id inside the label. I had only put an id inside the input.

Thanks!!

1 Like

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