Tell us what’s happening:
Hey everyone!!I tried this code but it isn’t correct…Can someone help me to solve it??
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"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> 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/80.0.3987.149 Safari/537.36
.
Challenge: Use the value attribute with Radio Buttons and Checkboxes
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
You haven’t added a value attribute to any of your radio or checkbox inputs.
ShAfi
March 27, 2020, 6:30pm
3
Add a value attribute to your input tags.
Example:
<input type="radio" name="indoor-outdoor" value="outdoor">
I tried it but again it isn’t right…Here is my code…
<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"value="indoor" name="indoor-outdoor"> Indoor</label>
<label><input type="radio"value ="outdoor" name="indoor-outdoor">Outdoor</label>
<label><input type="checkbox"name="personality" value"Energetic">Energetic</label>
<label><input type="checkbox"name="personality" value"Lazy">Lazy</label>
<label><input type="checkbox" name="personality" value="loving">loving</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
Sky020
March 28, 2020, 9:41am
6
Your code has been blurred out to avoid spoiling a full working solution for other campers who may not yet want to see a complete solution. In the future, if you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler]
and [/spoiler]
tags on the line above and below your solution code.
Thank you.
Sorry for your inconvenience
ShAfi
March 28, 2020, 10:21am
8
@Klaudia your value attributes value should be in lowercase (example: energetic instead of Energetic) and you’ve wrote two value attributes without an equal sign (energetic and lazy).
Still it doesn’t cahnge anything …I have tried multiple choices but nothing happens…
Sky020
March 28, 2020, 4:39pm
10
I recommend you reset your code, and start again. Follow the instructions and the example.
<label for="outdoor">
<input id="outdoor" value="outdoor" type="radio" name="indoor-outdoor">Outdoor
</label>