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

JavaScript Treehouse Club - MASH MASH - HTML Forms, Divs, and Inputs

Stuck again

Stuck

index.html
<body>
  <h1>First Day of School</h1>

  <form>

    <div>
      <h4>Favorite Foods?</h4>
      <input class="favorite_stuff[]">
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
    </div>

    <div>
      <h4>Favorite Animals?</h4>
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
    </div>

  </form>

</body>

5 Answers

Matthew Long
Matthew Long
28,407 Points

Part one of this challenge wants you to give both div elements the class favorite_stuff. It basically gives you the answer in the description.

<body>
  <h1>First Day of School</h1>

  <form>

    <div class="favorite_stuff">
      <h4>Favorite Foods?</h4>
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
    </div>

    <div class="favorite_stuff">
      <h4>Favorite Animals?</h4>
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
    </div>

  </form>

</body>

If you need help with the second part just add a comment and I'll help. Just keep in mind that this part also practically gives you the answer in the description. Happy coding! :smile:

Matthew Long
Matthew Long
28,407 Points

No problem! Look at the description of part 2. It basically says that the input elements, as written, are incomplete.

The input elements currently looks like this:

<input name="animal[]">

However, it is good practice to give each input element a type. These specific input elements are going to receive text so their type is text:

<input name="animal[]" type="text">

Now, every input element in the code needs to look like the following, for this example. Don't forget that the names should remain the same and the only thing you're being asked to add is the type. Give that a go! If you still need help I'll give you the full answer. Good luck!

Thank you! I am moving to step two!

You may have to coach me through this one. LOL

Thank you!