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

I can't get the code right on the MASH test. Can someone please help?

I keep getting the following error: The class attribute on both of your <div> elements needs to be set to "favorite_stuff".

I can't see where my code is wrong?

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

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

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

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

  </form>

</body>
Savannah Lynn
Savannah Lynn
13,662 Points

Hi, can you post your JavaScript code and maybe the original instructions you're following?

This is just on the quiz at the end of the Div tutorial, so I'm not touching the JavaScript. The quiz just keeps saying I got the answer wrong and giving me that error, but I have no idea why it's wrong and the quiz doesn't have a 'show correct answer' option! Ahhhh!

I got it! I was creating more work by putting the div class below the <div> statement, so it wasn't recognizing it. Thanks anyway, though!

1 Answer