Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Suli S
1,475 PointsLabeling elements
Hi
Which elements should have the label tag?
For example I know this is important for input text. But what others should have this?
1 Answer

Andres Chaves
3,462 PointsHi,
The <label> element does not render as anything special for the user. However, it provides a usability improvement for mouse users, because if the user clicks on the text within the <label> element, it toggles the control.
The for attribute of the <label> tag should be equal to the id attribute of the related element to bind them together.
You should use <label> tag with any element inside a form.
Corey Baker
4,890 PointsCorey Baker
4,890 PointsThis should help: HTML Label Tag