0
For what purpose the keyword" for" is used in <label> in forms??
4 odpowiedzi
0
in the forms it's used to bind label with a specific input for example. In fact you must use the same value for id in the input and for in the label.
for example:
<label for="name">Your name</label>
<input id="name">
0
what happens if we remove" for" ?
0
nothing will happens :) . I try to explain better. If you use for to bind label to a input, like radio or checkbox for example, then you can click or touch the input or the label for the same result. if you don't use for then you can't click on label to select his binded input
0
look to this example ... i've 2 radio control... the 1st is for male, the second for female. you can select control by clicking on the radio button or clicking his label. try to write for="female" in male label and viceversa
https://code.sololearn.com/Wcs33x3l6IFx/?ref=app