I recently completed the Registration Form project. I was a little confused with the instructions regarding value pairing between labels
and inputs
. It was my understanding that we link labels
and inputs
using the for
/name
attributes. However the instructions below advise on linking these elements using for
/id
. These types of instructions are repeated a few times throughout the course with other label
/input
elements.
When reading the html documentation, it re-affirmed that the name
attribute is what should be used to connect data submission functionality within a form. So please help me understand why in this lesson we pair for
with id
instead of name
. (note: we are asked later on to add name
attributes to all of the input
elements, but there is no requirement to ensure they match the for
attribute…)
Following accessibility best practices, link the
input
elements and thelabel
elements together using thefor
attribute.Use
first-name
,last-name
,new-password
as values for the respectiveid
attributes.