I was doing step 55 of the “learn html by building a cat photo app” i wanted to know why you would use this code
<input id="loving" type="checkbox"> <label for="loving"> Loving </label>
rather than this
<input id="loving" type="checkbox"> Loving
I was doing step 55 of the “learn html by building a cat photo app” i wanted to know why you would use this code
<input id="loving" type="checkbox"> <label for="loving"> Loving </label>
rather than this
<input id="loving" type="checkbox"> Loving
Hello.
When editing your post, press ctrl-e, you’ll see how to make code look like
this
And provide link to the challenge,please. Thanks.
well, this code doesn’t have correct syntax: no brackets at all, that’s not good for HTML
I guess you have question ‘why use labels’ also.
MDN article contains some explanation:
My apologies I messed up the syntax I fixed it. I will check out the article thank you
got it, so your question was about labels? or something else also?
It was more of, why use one over the other. The article answered this question, using a label allows a greater hitbox and allows screen readers to speak it. I see why I should use the code with label in it, rather than the other one. I appreciate the help!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.