my code won’t pass test no. 10. Says I don’t have my labels for name, email, and number specified as name-label, email-label, and number-label. Can you tell me why?
<h1 id="title">Survey for Luigi's Restaurant</h1>
<p id="description">We want to know what you think!</p>
<label for="name" id="name-label">
<input type="text" id="name" class="labels" placeholder="Enter your name" required></label>
<label for="email" id="email-label">
<input type="email" id="email" class="labels" placeholder="Enter your email" required></label>
<label for="number" id="number-label">
<input type="number" id="number" min="18" max="100" class="labels" placeholder="Age"></label>
How often do you come to Luigi's?
<li> <label for="month">
<input type="radio" name="visits" id="month" value="month">Once or twice a month</label></li>
<label for="weekly"><input type="radio" id="weekly" name="visits" value="weekly">Once a week</label></li>
<li> <label for="less"><input type="radio" name="visits" id="less" value="less">Less often than once a week</label>
What method do you use for testing the doneness of pasta?
<select id="dropdown" class="labels">
<option>Throw it against the wall and see if it sticks</option>
<option>Give it a taste test</option>
<option>You've mastered the cooking time to perfection</option>
How do you find the prices at Luigi's?
<li><label for="menu"><input type="checkbox" id="menu" value="menu">By looking at the menu</label></li>
<li><label for="reasonable"><input type="checkbox" value="reasonable" id="reasonable">Reasonable and fair</label></li>
<li> <label for="outrageous"><input type="checkbox" id="outrageous" value="outrageous">Outrageous</label></li>
Anything you'd like to add?
<textarea class="labels" rows="5">Comments</textarea>
<button type="submit" id="submit"> Submit</button></div>
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.
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 (’).
Hello and welcome to your first post!
For us to help you the best, we need the link to your page so we can see your code and what is going on. You can find it on codepen in details view, there will be a copy link button.
Then we can see the failed tests with your code and give you advice.
Without that it will be hard for us to help.
Yes, that does.
So one thing style wise first that is noticeable, the box lines for responses surpass your purple box border, and it looks unprofessional.
The test failing is asking for id markers for different elements. I am pasting my code that passed to show you the difference, and will include a link to my project. When I get stuck on a fail like this, I go back to the example, and look at their code to compare to. Most of the time it will clarify things.
Hopefully this can help you get the last test to pass.
Best wishes and warmest regards,
Hi, instead of enclosing the < input > tags with the < tag > tags, try leaving the < tags > on top of each < input > and enclosing the text and attaching the text inside the < label > tags that is, i.e .:
<label for="month">Once or twice a month </label>
<input type="radio" name="visits" id="month" value="month">
This will works.
My English is bad, I am Argentine!
If you modify all three, you will pass the test
@vflanagan, I normally tell people that when a test fails click the red button to see which test(s) are failing and text to help you correct the issue.
Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.
The failing test message says
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".
#name-label should contain some text : expected 0 to be above 0
AssertionError: #name-label should contain some text : expected 0 to be above 0
Now this may be a little vague but if you look at the
label for name, email and age there is no text. You have the text Name but it’s outside of the name
This will satisfy the requirement for the Name label. Only peek if a search doesn’t help and you need to understand the message better.
<label for="name" id="name-label">Name
<input type="text" id="name" class="labels" placeholder="Enter your name" required>
On a side note I’d say do not go back to the example. Search first. That should be the first thing you do. Then come to the forum and ask questions. Looking at other code and trying to figure out another’s thought process may not help you understand where something went wrong.
Thank you very much! It passed the test now. I guess I didn’t completely understand the error message
Glad to have been of some help.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.