Radio Buttons Each of your two radio button elements should be nested in its own label element. Each of your label elements should have a closing tag

Radio Buttons Each of your two radio button elements should be nested in its own label element. Each of your label elements should have a closing tag
0

Tell us what’s happening:
Please i need help! I have type as the examples state several times and i can not get it right.
these are the two portions of the test that i cannot seem to get correct.
Each of your two radio button elements should be nested in its own label element.

Each of your label elements should have a closing tag.

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">
<button type="submit">Submit</button> 
<label for="indoor">
 <input id="indoor" type="radio" name="indoor-outdoor">
 <label for="indoor">Indoor>
   </label>
 <label for="outdoor">
   <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 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.

Challenge: Create a Set of Radio Buttons

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

In both cases, you created have two opening tags (but only one closing tag). You also have extra >s.

1 Like

Thank you Ariel !
I must bug you for something else , I cannot seem to figure this out.
Each of your two radio button elements should be nested in its own label element.

If you are asking about the same challenge, you will need to post your latest code in a reply. To 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.

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.

2 Likes

Hello

how do i add the radio button elements within the form tag?

i have figured it out thank you

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

This is my code and the test will not accept it please help
Thank you
submit

<input id=“indoor” type="radio name=“indoor-outdoor”>
Indoor


Outdoor>

 type="radio name=

You are missing the " after “radio”.

Thank you Ariel Leslie for your response, However I am still getting the error message after the correction this is the only one I have wrong please help.

<button type="submit">Submit</button>  
 <label for="indoor"></label>
   <input id="indoor" type="radio" name="indoor-outdoor">
  <label for="indoor">Indoor></label>

 <label for="outdoor"></label> 
<input id="outdoor" type="radio" name="indoor-outdoor">
<label for="outdoor">Outdoor></label>

You have two completely empty (useless) label tags like this:

 <label for="indoor"></label>

And you do not have your input elements nested in label tags. Being “nested” means being in between the opening and closing tags.

<input id ="indoor"type="radio"name="indoor-outdoor">
  <label "indoor">Indoor</label>
  <input id="outdoor"type="radio"name="indoor-outdoor">
  <label "outdoor">Outdoor</label>

Still cant find the answer

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 it 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.

You still haven’t done this.

Thank you Ariel Leslie I pass this section.

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

Congratulations on figuring it out. Happy coding!

Hello Ariel Leslie,
Can you help me with this challenge?


  <input type="radio"name="indoor-outdoor"checked>Indoor</label>

  <input type="radio"name="indoor-outdoor">Outdoor</label>

  <input type="checkbox"name="personality"checked>Loving</label>

  <input type="checkbox"name="personality">Lazy</label>

  <input type="checkbox"name="personality">Energetic</label>

You have closing label tags, but no opening label tags.

I put the opening label tag it did not work I will try again.

Ariel Leslie, Still will not let me pass.


  <label><input type="radio"name="indoor-outdoor"checked>Indoor</label>

  <label><input type="radio"name="indoor-outdoor">Outdoor</label>

  <label><input type="checkbox"name="personality"checked>Loving</label>

  <label><input type="checkbox"name="personality">Lazy</label>

  <label><input type="checkbox"name="personality">Energetic</label>