Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Greg Ryan
Greg Ryan
1,777 Points

Treehouse club MASH. what do you need to put into the html code to give the <div> class attributes?

I am stuck with what to do to give the <div> class attributes. I have input <div class="favorite_stuff"> in the same place as the tutorial code for the course. I doesn't seem to be working though. Please help!

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

  <form>

    <div id="answers" class="hide">

    </div>

    <div class="favorite_stuff">

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

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

  </form>

</body>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

You're actually doing brilliantly. The problem is that you're not doing what it asks in step 2 of the challenge. It never says anything about adding a new div with class="hide" or id="answers". Now, it may have that in the video, but it's not asked for here. Keep in mind that challenges are extremely strict and if you do something above and beyond what they ask you to do... there's about a 99% chance the challenge will fail.

The second step asks you to put a type on all the inputs. Here's an example:

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

With that hint in mind, give step 2 another go. You've got this!

Greg Ryan
Greg Ryan
1,777 Points

Thanks Jennifer, I eventually managed to work out where I went wrong. I had to assign a <div> attribute to the whole thing then an attribute to both blocks of code. It took me a while though!!