HOW TO MAKE RADIO Buttons answer

Tell us what’s happening:

‘how to put radio buttons and answer’


Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats

**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362</code>.

**Challenge:** Create a Set of Radio Buttons

**Link to the challenge:**

Try the hints here: freeCodeCamp Challenge Guide: Create a Set of Radio Buttons

If you are still stuck; someone will try to help :slight_smile: just post your current code in a response with 3 back ticks ``` (shift ~ button)

Or for whoever doesn’t have it on the keyboard: ALT + 96

Here is my solution for that

Indoor Outdoor
1 Like
  <p>Click here to view more <a href="#">cat photos</a>.</p>

  <a href="#"><img src="" alt="A cute orange cat lying on its back."></a>

  <p>Things cats love:</p>
    <li>cat nip</li>
    <li>laser pointers</li>
  <p>Top 3 things cats hate:</p>
    <li>flea treatment</li>
    <li>other cats</li>

<form action="/submit-cat-photo">
    <input type="text" 
placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
<label for="Indoor"> 
  <input id="Indoor" type="radio" name="indoor-outdoor">Indoor

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


It keeps giving me the error that each label element must have a closing tag.  Am I missing something?

Figured it out, the code was correct, I had a in a comment i had added at the bottom of the document. Doh.

for the create radio button you should know 2 tip.
first input element have type=“radio” attribute it create radio buton.
second input name should be same other wise you choose both button then no meaning radio button its turn checkbox.
<input type=“radio” name=“color”< white
<input type=“radio” name=“color”< black
note:when ı write <input(>) my writing is not visible.

1 Like

Thanks alot This solution really helped and allowed me to continue with the program