Just this one label isn’t showing up on my form. What am I doing wrong??
<label id="recommend" name="recommend">Would you recommend freeCodeCamp to a friend?</label>
<input type="radio" id="definitely" name="answer" value="Definitely">Definitely</>
<input type="radio" id="notsure" name="notsure" value="answer">Not Sure</>
<input type="radio" id="no" name="no" value="answer">No</>
HeatherFeather:
Definitely</>
What are these things at the end of the second, third, and fourth lines?
Your usage of id attributes seems off too.
Aren’t the input tags self closing? My issue is getting the question to show up - Would you recommend freeCodeCamp to a friend? I have done all of my other labels in the exact same way and they all show up. Just not this one
If they are self closing, then you don’t need to add whatever </>
is
I review how labels and radio buttons work because you have multiple problems.
Those are showing up okay, (I just need to find out how to make only one selectable) But this issue with my label has stumped me for hours.
You have multiple problems. Just because you can see the other labeles does not mean they are correct.
You have multiple problems with that code.
those </>
things are not valid HTML
label elements take for attributes, not id attributes
linked radio buttons should all have the same name
two radio buttons should not share the same value
each button usually has its own label
I would check all of your code for these sorts of bugs
1 Like
Radio buttons are fixed, but the </> is showing as how I close a label
It isn’t. Don’t use </>
as it’s not valid HTML. I promise I’m not lying to you.
Learn to Code — For Free
You should review how these parts work. Forgetting stuff is totally normal.
1 Like
Yeah it’s pretty discouraging. I thought I had finally understood it. I’m still completely confused why all of the other labels are showing, and not this one. I styled them EXACTLY the same
<label id="recommend" name="recommend">Would you recommend freeCodeCamp to a friend?</label>
<input type="radio" id="definitely" name="answer" value="definitely">Definitely</input>
<input type="radio" id="notsure" name="answer" value="notsure">Not Sure</input>
<input type="radio" id="no" name="answer" value="no">No</input>
</div>
Okay, tried it, but the only way I could get that label to show up is if I did an input as radio. SO now it has a radio button beside it. I’m so frustrated
That’s just how coding codes - learning is hard, coding is hard, and learning coding is hard.
label
elements don’t use id
attributes. They use for
attributes that correspond to another element’s id
.
Typically each input element has its own label element.
input
elements don’t have closing tags
I’m just going to have to step away for a moment. I’m ready to launch my computer out the window LOL
I’ve edited your code 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 (').
Can someone please help? I just did the entire HTML course again and still can’t figure out why this one sentence will not display?
This code doesn’t work
<label for="recommend" value="question"> Would you recommend freeCodeCamp to a friend?</label>
This one does.
<label for="role" id="question">Which option best describes your current role?</label>
value
is not an attribute associated with label
elements.
It really helps if you post all of your code instead of one small part.
<html>
<head>
<title>freeCodeCamp Survey Form</title>
<link rel="stylesheet" href="styles.css">
<meta charset="UTF=8" lang="en">
</head>
<body>
<h1 id="title">freeCodeCamp Survey Form</h1>
<p id="description">Thank you for taking the time to help us imrpove our platform</p>
<form id="survey-form" action:"https://survey-form.freecodecamp.rocks/">
<label for="name" id="name-label">Name</label></br>
<input id="name" type="text" placeholder="Enter your name" required></br>
<label id="email-label">Email</label></br>
<input required type="email" id="email" name="email"placeholder="Enter your email address"></br>
<label id="number-label">Age</label></br>
<input type="number" id="number" name="age" min="13" max="125" placeholder="Age"></br>
<label for="role" id="question">Which option best describes your current role?</label>
<select id="dropdown">
<option value="" placeholder="Select your role">
<option value="Student">Student</option>
<option value="Full time job">Full-time job</option>
<option value="Full time learner">Full-time learner</option>
<option value="Other">Other</option></br>
<div>
<label for="recommend" id="question"> Would you recommend freeCodeCamp to a friend?</label>
<select id"radio>
<input type="radio" name="answer" value="none">
<input type="radio" id="definitely" name="answer" value="definitely">Definitely</input>
<input type="radio" id="notsure" name="answer" value="notsure">Not Sure</input>
<input type="radio" id="no" name="answer" value="no">No</input>
</div>
</form>
</body>
</html>
I would use an HTML validator like this: Ready to check - Nu Html Checker
Then I’d fix all the errors the validator shows you.
And, again, you should have one label per input instead of one label for a whole chunk of inputs.
It looks like that for
attribute here doesn’t correspond to any of your inputs:
1 Like
Ohhhh that site is cool! Thanks
1 Like
Someone PLEASE help me. I’ve been trying to get this question to show up on my form for 2 days. I’ve run it through multiple text editors. PLEASE HELP
<div class="form-group">
<p>Would you recommend freeCodeCamp to a friend?</p>
<select id="radio">
<input type="radio" name="answer" value="select answer">
<input type="radio" id="definitely" name="answer" value="definitely">Definitely</input>
<input type="radio" id="notsure" name="answer" value="notsure">Not Sure</input>
<input type="radio" id="no" name="answer" value="no">No</input>
</div>