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 Add Labels

i'm missing something on the textarea?

the text area label won't accept it before or after?

index.html
<!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">
      <label for="comment">comment</textarea>

      <button type="submit">Submit Comment</button>
    </form>

  </body>
</html>

2 Answers

Hi Kim

You can put the label before or after the textarea if you want.

I think this is Treehouse being picky and failing because you have not written the label text exactly the same "Comment:", but for everything else, it looks fine.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>HTML Forms</title>
  </head>
  <body>

    <form action="index.html" method="post">

      <!-- You can put the label above -->
      <label for="name">Name:</label>
      <input type="text" id="name" name="user_name">

      <!-- You can put the label below -->  
      <textarea id="comment" name="user_comment"></textarea>
      <label for="comment">Comment:</label> 

      <button type="submit">Submit Comment</button>
    </form>

  </body>
</html>

Good Luck!

Haisam Elkewidy
Haisam Elkewidy
26,987 Points

You need to put it before the textarea element. When you try to submit your code that way, you should get an error of some sort that clarifies that.

I tried that too. But I'll try it again. I'm probably missing something