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

Immanuel Jaeggi
Immanuel Jaeggi
5,164 Points

My lables don`t focus on the corresponding fields when clicked on.

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

The above is an example of what I did and it still does not focus on the corresponding field when I click it. Any ideas? Tx

2 Answers

Steven Parker
Steven Parker
231,236 Points

Is just a spelling issue. You wrote "lable" instead of "label" (twice).

It's normal for HTML tags that are not recognized to be simply ignored by the browser. But the text is still rendered (as a plain text node).

Browser's won't reveal this type of error but you can run the page through an HTML validator. The "official" online validator is available at validator.w3.org.

Immanuel Jaeggi
Immanuel Jaeggi
5,164 Points

Thanks a lot for your help.

Immanuel Jaeggi
Immanuel Jaeggi
5,164 Points

Nooooo! Txs! Would you know why I still was able to see the labels name, email, etc although the element was spelt wrong? It seems to me that it shouldn't have rendered the form with all the labels. Then I would have known where to check for errors.

Jack Weldon
Jack Weldon
1,708 Points

it's the closing tag that is misspelt, meaning that the attribute won't load properly (In this case the focus). Since the tag is open, it's taking everything after the attribute to be the focus destination. Correct the spelling in the closing tag and give it another shot.

Steven Parker
Steven Parker
231,236 Points

I expanded my answer to explain the text rendering.