Survey form, cant pass the test

Tell us what’s happening:
ive got 16 out of 17, it tells me that for the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: id=“name-label”, id=“email-label”, and id=“number-label”.

as you can see down here on my code, i put all the corresponding labels, i cant find the mistake…

Your code so far

            <form id="survey-form">
          <div class="form-group">
            <div class="name">
          <label id="name-label" for="name-label">Name</label>
          <input
                 type="name"
                 name="name"
                 id="name"
                 placeholder="Enter your name"
                 required/>
            </div><br>
            
            <div class="email">
            <label id="email-label "for="email-label">Email</label>
            <input
                   type="email"
                   name="email"
                   id="email"
                   placeholder="Enter your email address"
                   required/><br><br>
            </div>
            <div>
            <label id="number-label" for="number">Age</label>
            <input
                   type="number"
                   name="age"
                   min="15"
                   max="80"
                   id="number"
                   placeholder="Enter your age"
                   required/><br><br>
            </div>

Your browser information:

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

Challenge: Build a Survey Form

Link to the challenge:

Look below the failed test, it says the reason (and report that here please)

I don’t see a name input field. At your email-label id you’re missing a " at the end of email-label.

#email-label is not defined : expected null to not equal null
AssertionError: #email-label is not defined : expected null to not equal null

i did however put a label on it

Email

ok, yes, you don’t have an element with id of `#email-label

I see an element with id="email-label " (you need to remove the space)

also, the for attribute of that element has the wrong value

if it is not this you have syntac errors outside of what you posted.
Also, wait, let me do a thing.

I’ve edited your post for readability. 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.

Please 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.

markdown_Forums

1 Like
<label id="email-label" "for="email-label">Email</label>

your email label should look like that ,if you don’t close the brackets of the string then the id won’t exist

1 Like

thank you @ieahleen, it worked!! the ‘for’ attribute was wrong.

im still learning. there are so many things that i need to improve on HTML and CSS, i still need to learn how to make my code clean and tidy! do you usually start with html and then css or you change every line while youre still working on HTML?

That’s not a question for me, I have never completed a project.