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 trialMUZ140735 Prosper Poshayi
4,835 Pointswhere am i going wrong
im getting a bummer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Forms</title>
</head>
<body>
<form action="index.html" method="post">
<input type="text" id="name" name="user_name">
<textarea id="comment" name="user_comment"></textarea>
<button type="submit">Submit Comment</button>
<label>for=">Name:</label>
</form>
</body>
</html>
3 Answers
Frederico Graciano
Courses Plus Student 2,768 PointsWhat Dan Oswalt said it's wrong. A part of it it's wrong.
the for attribute is equal to the Input ID attrtibute. So your input id is name. The correct way is this:
<label for="name">Name:</label>
Now you should put the label element before the input element. like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Forms</title>
</head>
<body>
<form action="index.html" method="post">
<label for="name">Name:</label> <input type="text" id="name" name="user_name">
<textarea id="comment" name="user_comment"></textarea>
<button type="submit">Submit Comment</button>
</form>
</body>
</html>
MUZ140735 Prosper Poshayi
4,835 Pointsok thanx Dan
Dan Oswalt
23,438 PointsYour code is messed up here:
<label>for=">Name:</label>
This should be written
<label for="Name:"></label>
MUZ140735 Prosper Poshayi
4,835 Pointsstill im getting a bummer:
Bummer! You need to set the 'for' attribute to "name".
Dan Oswalt
23,438 PointsDan Oswalt
23,438 PointsSorry! Should have looked closer at the question.
MUZ140735 Prosper Poshayi
4,835 PointsMUZ140735 Prosper Poshayi
4,835 Pointsthanx it worked out