+ 3
use of "FOR" attribute in html
<label for="email">Your e-mail address: </label>
5 ответов
+ 3
<label for="email>You Email Address:</label>
<input name="email" id="email" type="email" />
^the "for" attribute is referencing the input with the same name (ID attr). The purpose is so that if you click on the label, it'll put the cursor inside of the input box for you.
Further resource:
https://www.w3schools.com/tags/tag_label.asp
+ 3
I wonder how we can create the password from dots to*******. Do you guys agree?
+ 2
When used together with the <label> element, the for attribute specifies which form element a label is bound to.
+ 2
Yes, I'm referring to the ID, but I see what you're saying when I read it again. I meant the input with the same name, but not as in its name attribute. However, you're absolutely correct; it's based upon the ID of the element.
*edit*
I put it in parenthesis to prevent any confusion.
+ 1
Simple correction: the label seeks for the id not the name attribute.