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

Hi all, this is my first test and I’m stuck! It’s the last part I need to get correct. I have googled and searched this forum to no avail. I cannot see the error. As far as I can see I do have a <label element with the id=“label-name”

My code in the Survey test so far.

<!doctype html>

Survey

Please complete the survey.

<div class="form-group" Name
Email
Age

Choose An Option

<input id="mayo" type="radio" value="mayo" name="sauce" <input id="ketchup" type="radio" value="ketchup" name="sauce" <input id="bacon" type="radio" value="bacon" name="flavor" <input id="cheese" type="radio" value="cheese" name="flavor" Extra Cheese Extra Hot
<textarea id="text">Leave your comments here</textarea>
<input id="submit" type="submit"></input>

Thank you for help with this.

Helen

Welcome to the community @harveywebsitedesign !

Could you please use the Help that appears after three unsuccessful attempts at any step in Responsive Web Design?
Currently, I am not seeing any label element tags at all.

Seeing the complete code, for both the html index and the css styles, allows the community to offer direct and accurate guidance.

Happy coding!

1 Like

I did that a number of times plus googled and couldn’t find the answer. I wasn’t sure how to show you my code? So, I will upload a screenshot instead.

Hope that works or please let me know a better way to do it

firstexercisesurvey

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" href="styles.css">
    </head>

<h1 id="title">Survey</h1>

<p id="description"> Please complete the survey.</p>

<form id="survey-form">
  <div class="form-group"
    <label id="name-label">Name</label>
      <input name="name" id="name" type="text" placeholder="Enter Your Name Here" required></input>
    </div>
  
<form id="survey-form">
  <div class="form-group">
    <label id="email-label">Email</label>
      <input type="email" name="email" id="email" placeholder="Enter Email Here" required></input>
  </div>

<div class="form-group">
  <label id="number-label">Age</label>
    <input type="number" id="number" min="10" max="99" placeholder="Enter Age Here"></input>
    </div>

  <label for="food">Choose An Option</label>
    <select id="dropdown" name="food">
      <option value="crisps" >Crisps</option>
      <option value="sweets ">Sweets</option>
    </select>

  <label for="mayo">
    <input id="mayo" type="radio" value="mayo" name="sauce"</input>
    </label>

  <label for="ketchup">
    <input id="ketchup" type="radio" value="ketchup" name="sauce"</input>
    </label>

  <label for="bacon">
    <input id="bacon" type="radio" value="bacon" name="flavor"</input>
    </label>

<label for="cheese">
    <input id="cheese" type="radio" value="cheese" name="flavor"</input>
    </label>

  <label for="Extra Cheese">
    <input type="checkbox" value="extracheese">Extra Cheese</input>
    </label>

  <label for="Extra Hot">
    <input type="checkbox" value="Extra Hot">Extra Hot</input>
    </label>
  
    <textarea id="text">Leave your comments here</textarea>
    <input id="submit" type="submit"></input>
  </form>

</html>

Hope this helps. It says I don’t have a label with an id of name-label but I do, so I’m not sure what is wrong.

We have a lot of challenges, and I am not sure which one this is off the top of my head. Can you post a link to the challenge

1 Like

Oh I’m so sorry. It’s creating a Survey. The last test from first section.

<div class="form-group"
    <label id="name-label">Name</label>

Do you notice something missing here in your code before the label starts?

1 Like

Oh my god, I can’t believed I looked at this so long and couldn’t see the missing closing tags on the div. Thanks so much for spending the time to help me. I really appreciate it.

2 Likes

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