Radio Buttons set im stuck

Tell us what’s happening:

I have been trying to solve this but been stuck all day! this is the prompt-

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.

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="indoor" type="radio" name="indoor-outdoor">  <Label for="outdoor"> Indoor</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 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/create-a-set-of-radio-buttons/Preformatted text

change indoor to outdoor
:slight_smile:

1 Like

Oops, thank you!!!
I am still getting these two errors-

Give your radio buttons the name attribute of indoor-outdoor .

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

I am confused !

1 Like

change it to outdoor
<input id="outdoor" type=“radio” name=“indoor-outdoor”> outdoor

check this out

<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">outdoor

<label for="outdoor"> Outdoor</label>

<input type="text" placeholder="cat photo URL"required>

<button type="submit">Submit</button>

</form>

</main>

Thank you, however
This is what I currently have and it still shows that I need to have
Give your radio buttons the name attribute of indoor-outdoor .

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

okay got it

you didn’t give your radio buttons the attribute with label for=indoor
this is for the first one after you finish close it then starts a new one label for=outdoor

tell me if it works out

good luck

33%20AM

1 Like

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 easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

1 Like

you are missing this: you have not nested the input elements inside the label elements

1 Like