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

HTML HTML Forms Organizing Forms The Label Element

Brent McDonald
Brent McDonald
1,261 Points

My labels don't focus on the elements when clicked like in the tutorial. Is this still a supported function?

I have copied the label element as instructed on the tutorial i.e:

<label for "name">Name:</label>

However, it doesn't focus on the field when clicked like in the video. The input names are correct in the labels. I was wondering whether it's supported on Chrome, or if this functionality is no longer compatible. I'm pretty stumped as it's a simple line of code that has been copied exactly.

       <label for "name">Name:</label>
       <input type="text" id="name" name="user_name">

I look forward to hearing users' feedback on my query. Thanks.

2 Answers

Brent McDonald
Brent McDonald
1,261 Points

Realised i needed to add '='

Sorry!

Valerie Smith
PLUS
Valerie Smith
Courses Plus Student 5,244 Points

I have the same problem, only I do have the '=' in the code! Very confused

Marc Eclipse
Marc Eclipse
6,958 Points

@Valerie: It's definitely due to a syntax/spelling issue.

Christopher Debove
Christopher Debove
Courses Plus Student 18,373 Points

Hello. Maybe a little late, but did you checked that the value of your for attribute is matching the value of the id attribute of the field you want to target when clicking on the label?