+ 1
What's the use of <label> tag?
Hello everyone! I can't seem to understand the way to use the <label> tag in HTML? To me, it just looks like a regular text within a form? Is there a reason why this tag is used here? Also, are these some other uses of this tag that might enlighten me as to the sense of it? I know it's probably a very beginner question but I can't find the explanation of the proper use of this tag in here. Thank you very much for your support!
7 Answers
+ 2
Click on the text present at the left side of radio. First set uses label.
Second set doesn't.
See this:
https://code.sololearn.com/WDu934ngAbrZ/?ref=app
+ 2
One of the uses of label is that when you use input type=radio or checkbox, and you use label for it, then when you click on the label, it alters the value of the radio or checkbox. It basically links each other.
+ 2
No it's not necessary. If you have a label for input tag, if you click on the text that is in that label, the input can be changed.
+ 1
do you mean that <label> is necesseary for dealing with the collected data? I thought it was more the "name" part of the <input> tag that was doing this job? or maybe there's still something i dont understand...
+ 1
i got it!! thank you man, its amazing :))
+ 1
https://code.sololearn.com/WyCHzgnUweCG/?ref=app
updated my code thanks to you ;)
+ 1
Nice code you have there! đđ»
And glad I could help clear one of your doubts.