Problem is assigning `for` attribute of `label` tag a value

Tell us what’s happening:
I have given the label tag the for attribute and have given the same value to the radio button . But I don’t know why it is still not letting me submit. Please show me my error , I can’t seem to find it :sweat_smile:
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="https://freecatphotoapp.com/submit-cat-photo">
  <input type="text" placeholder="cat photo URL" required>

<label for = "indoor">
<input type = "radio" id="indoor" name ="indoor-outdoor">
</label>
<br>
<label for ="outdoor">
<input type ="radio" id ="outdoor" name ="indoor-outdoor">
</label>  
  <button type="submit">Submit</button>
</form>
</main>
  **Your browser information:**

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

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Nevermind I got it . I’m so stupid lol . Wasn’t even a mistake in my coding or syntax , just a silly mistake.

You forgot the words “indoor” and “outdoor” that would appear as the label on the page.

1 Like

Help, I came back months later to this feed after completing the challenge as I was curious as to what I did correct and I can’t remember!Help!

I’m not a mind reader but from looking at your code I’d say you revisited the sample that was in the lesson and realized that your radio buttons were missing the labels, Indoor and Outdoor respectively.

Revisit the lesson, look at the example showing the input element nested within the label element and you’ll see what I mean.

I see what you mean and even tried it but that’s not what’s wrong. I have both my radio buttons nested in their respective labels with respect to their assigned ID’s but still it is throwing an error that says------------

One of your radio buttons should have the label indoor .

One of your radio buttons should have the label outdoor .

Without seeing your code all anyone can do is guess.

The original code is missing each of the labels. If you look in the preview pane all you see is two radio buttons with no labels.

If the code has been updated, please be sure to include it so we can see.

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 (’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.