Help in Basic HTML Course

Good morning! I am having issues with this step as I keep getting the following error and I am not sure how to fix it after watching the video and having exactly the same code entered into mine? here’s the error:

" Each of your two radio button elements should be nested in its own label element."

Your code so far


<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input id="indoor" type="radio" name="indoor-outdoor">
  <label for="indoor">Indoor</label>
  <input id="outdoor" type="radio" name="indoor-outdoor">
  <label for="outdoor">Outdoor</label>
  <input type="text" placeholder="cat photo URL" required>    
  <button type="submit">Submit</button>
</form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0.

Challenge: Create a Set of Radio Buttons

Link to the challenge:

look at the explanation again, you should see that you dont have everything nested inside the label items.

reset the code, and have another look

<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>

  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <label for="indoor"><input id="indoor" type="radio" name="indoor-outdoor"> Indoor</label>
    <label for="outdoor"><input id="outdoor" type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

input labels must be nested inside label labels

1 Like

I am so confused lol, I don’t see how I would’ve ever come to this solution with the “hint” and the “help video” provided. The solution you provided looks so much different than both of those items but thank you!! I’m already starting to feel hopeless unfortunately

haha yeah I didn’t need the actual code but I still don’t understand how it got to from what I had to what the answer is. The instructions/hints aren’t helping much either - feeling lost this early can’t be a good sign. Thank you for the input and help though, much appreciated!

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Thank you for understanding.

1 Like

its very easy to start typing away with the prompts on the instruction side, without fully understanding what your actually doing. and thats honestly understandable and you wont be the only person to do that, i’m currently on my 3rd run through the html/css section and it kind of feels like auto pilot, wihtout fully reading what the instructions are/mean…

But enough about me.

have a look at this vid from the tutorials bit:

it might be worthwhile, forms can be quite a muddled up when your first exposed to them. so be patient with yourself!

2 Likes

I JUST started it over and figured it out…much thanks everyone!!

and I will def watch the video as well paul…/cheers

not a problem at all. its honestly worth searching the vid section, as theres a surprising amount of good stuff in there