I cant understand how to set the name in label for="

Tell u Loving
Sleepys what’s happening:

Describe your issue in detail here.

  **Your code so far**

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

<a href="#"><img src="https://www.bit.ly/fcc-relaxing-cat" 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="https://www.freecatphotoapp.com/submit-cat-photo">
  <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>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36.

Challenge: Create a Set of Checkboxes

Link to the challenge:

I don’t understand what you are asking.

in this three types of chekbox they set three different names in lavel for and id. so i do not understand how to set those name … imean accoroding to waht ?

The “label for=” and “id” tag must match, but you choose whatever word you want it to be.

Imagine someone visually impaired filling out your form. They can’t read what your different checkboxes are, but their screen reader reads out to them what all the options are. What does the screen reader read? Whatever word you input into the “label for=” element. So naturally, you want to make sure that whatever word you choose explains what the option is. That’s why you see in the exercise examples that the “label for=” attribute is the same as what will be displayed on the screen. So that the person using the screen reader receives the same information as the person looking at the screen.

I hope this makes sense.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.