<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="https://freecatphotoapp.com/submit-cat-photo">
<label for=indoor>
<input id="indoor" type="radio" name="indoor-outdoor"indoor placeholder="cat photo URL" required>
<button type="indoor">indoor</button>
</label>
<label for=outdoor>
<input id="outdoor" type="radio" name="indoor-outdoor"outdoor>
<button type="outdoor">outdoor</button>
</label>
</form>
</main>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
.
Challenge: Create a Set of Radio Buttons
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.
Está un poco mesclado tu código.
1.- placeholder=“cat photo URL” required … tiene que estar en una etiqueta aparte
2.- for = indoor … el nombre tiene que ir con comillas for = “indoor”
3.- el texto indoor y el texto outdoor tiene que estar fuera de la etiqueta de input
<input id=“indoor” type=“radio” name=“indoor-outdoor”> indoor
4.- no es necesario utilizar la etiqueta button en este challenge, se tiene que utilizar la etiqueta label
Al final el formulario tiene que quedar algo así:
<form action="https://freecatphotoapp.com/submit-cat-photo">
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button><br>
<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>
</form>
2 Likes
@sasel27
No necesitas el boton dentro del ‘label’.
<label for="indoor">
<input id="indoor" type="radio" name="indoor-outdoor">Indoor
</label>
En la leccion te provee el ejemplo/modelo del syntax para agregar los ‘radio’ botones.
Lo unico que cambia es 'for=…" y 'id=…" para que refleje ‘outdoor’ y ‘indoor’
1 Like
<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="https://freecatphotoapp.com/submit-cat-photo">
<label for=indoor>
<input id="indoor" type="radio" name="indoor-outdoor"indoor placeholder="cat photo URL" required>
<button type="indoor">indoor</button>
</label>
<label for=outdoor>
<input id="outdoor" type="radio" name="indoor-outdoor"outdoor>
<button type="outdoor">outdoor</button>
</label>
</form>
</main>
Aquí no necesitas este <button>
. Es suficiente si pones un texto dentro de <label>
Por ejemplo algo así:
<label for="estrella-galicia">Estrella Galicia
<input type="radio" name="cerveza" value="estrella-galicia"
id="estrella-galicia" />
</label>
Y también aquí hay demasiados de outdoor
y indoor
1 Like
Please do not create multiple forum topics for the same subject. I have merged your topics.