Hiya, I’m doing the FreeCodeCamp for HTML 5 and have hit a brick wall with code for a task.
Task
Add a pair of radio buttons to your form, each nested in its own label element. One should have the option of indoor and the other should have the option of outdoor. Both should share the name attribute of indoor-outdoor to create a radio group.
My code
Indoor
Outdoor
Submit
Error response
Each of your two radio button elements should be nested in its own label element.
Can anyone spot an obvious error?
Many thanks
EvaTell us what’s happening:
The challenge asks you to create an input with a type of “radio” that is nested inside its own label. You successfully created the inputs, but you didn’t nest them. In Programming, nesting means putting a function or element inside another element or function. In HTML specifically, it’s putting an element inside another element. Ex:
<div>
<p>This paragraph is nested inside a div tag </p>
</div>
We can’t help you by giving you the code answer. We can help you try to figure it out, but the rest is on you. That’s how you learn. I already gave you a couple example. Here’s another one:
<div>
<label> This label is nested inside a div </label>
</div>
It seems like you may be watching the videos instead of reading the challenge descriptions. The videos are great, but they don’t always tell you how to exactly pass the challenge. You always need to read the challenge description carefully.
lol I thought that’s what you were doing. OK cool. I will go back and re-study it. I don’t recall seeing the div bit on the previous sections of the learning though. I may have missed it… Thank-you for your help
Hey ieahleen - thanks so much for your help. What may appear obvious to some, may not always be the case for others. I will revisit my code, correct it and re-study where I went went wrong