I NEED HELP WITH THIS CHALLENGE - Use the value attribute with Radio Buttons and Checkboxes

Tell us what’s happening:

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

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

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

<label><input type="checkbox" name="personality" value="Loving"> Loving
</label>
<label><input type="checkbox" name="personality" value="Lazy"> Lazy
</label>
<label><input type="checkbox" name="personality" value="Energetic"> Energetic
</label>
<br>   
  
<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; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36.

Challenge: Use the value attribute with Radio Buttons and Checkboxes

Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/use-the-value-attribute-with-radio-buttons-and-checkboxes

see the bold part:

Give each of the radio and checkbox inputs the value attribute. Use the input label text, in lowercase, as the value for the attribute.

2 Likes

Welcome to the freeCodeCamp forums!

A good way to get a hint if you’re stuck is to see what the tests are asking for. In this case, the tests are asking for

One of your radio buttons should have the value attribute of indoor.

If you’re still stuck, it’s good to re-read the prompt and look at the examples provided. They usually provide hints or in this case outright give you the solution.

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

This input element has the attributes id, value, type and name. Now that you know how to give an element a value attribute, you just need to give each element the appropriate one. Good luck!

1 Like

Hello~!

Please do not make duplicate replies. :slight_smile: