I can't understand for attribute in HTML can anyone help me

I can’t understand for attribute in HTML can anyone help me .

Your code so far

<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>
  <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://freecatphotoapp.com/submit-cat-photo">
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
  <input type=radio name="indoor-outdoor">Indoor</input>
  <input type=radio name="indoor-outdoor">Outdoor</label>

Your browser information:

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

Challenge: Create a Set of Radio Buttons

Link to the challenge:

I’m terrible at explaining code and don’t want to just give the answer. You’re missing quotation marks around some things, so review your code and try adding " " around some words.

1 Like

Hi, there is code in the challenge showing how to write the for attribute and a paragraph below giving you information about the for attribute. Please go back an review this, it’s not too complicated.

Also, as MMiles suggests, double check your code for missing " " and make sure all of your form inputs and buttons are nested inside the opening and closing form tag. Good luck.

1 Like

i am not able to understand for attribute from that code and paragraph

What don’t you understand? What have you tried? Can you be more specific with what problems you’re having?


What is the use of for attribute

It associates a label with a corresponding input. It helps screen readers (and other software for accessibility) work correctly.

1 Like

thanks for that info

I’m glad I could help.

1 Like