Hi! I don’t have a problem with this step, but I’m curious about the code added here.
In one of the previous steps, I added the “for” attribute to the checkboxes, and the guide said this is another option to add a specific value to the attributes, instead of the “value=” attribute that was used on the radio buttons.
However, this step 60 asks us to add the “value=” attribute to the checkboxes regardless, so does this not make the “for=” attribute useless in the code then?
I just meant that is there a difference in the code for radio that is fully inside the label, and the code for checkbox, that has the for inside the label only.
You said that for is added to the label to tell the browser that the label is connected to an input element. The codes for radio do not have this “for” attribute so does the browser not know this then?
there is a difference in something called the DOM.
input inside label means the input is a child of the label.
whereas the other option the label and the input are siblings.
I am kind of losing track of where this conversation is going as at the beginning you seemed to be confused about for and value.
These are two different things and do different things.
I hope that is at least clear now.
Yes sorry my confusion was simply in that the task had us code the radio and checkbox lines differently, while giving the idea that they do the same things, which is why I was confused why one line was without for and one with for and what the difference was.
they want you to see different ways of writing the code.
Nesting the input inside the label creates a relationship between them immediately.
But if you can’t do that, then use the for attribute.