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! While you're at it, check out some resources Treehouse students have shared here.

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

Development Tools

jason limmm
jason limmm
7,791 Points

label element error in chrome dev tools

here is my snapshot:https://w.trhou.se/7u21oc2hp1

for some reason the chrome devtools says that my label's for attribute is different from my input element's id although i already set it to be the same

1 Answer

Steven Parker
Steven Parker
230,946 Points

HTML rules require that every ID on a page be unique. But as it is now, both the div with class "flex form" and the input have the id "name".

Give the form a different (and unique) id and the browser will correctly associate the label with the input.