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

Steffen Fylkesnes
Steffen Fylkesnes
1,208 Points

Getting div class to apply

There is nothing in the previous material that makes it readily apparent, at least to me, what the issue is here.

The "Bummer!s" are of no help, and only confuse me further as no matter how i shift the line around it seems to suggest the div class is applying to one of the elements, with no clue as to why it isn't applying to the other even though the syntax is ctrl-c'd from the top of the challenge.

what's wrong here? and please improve this code challenge, as clarity is all over the place.

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

  <form>

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

1 Answer

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

Hi there! You're soooo close here. But you did something they weren't expecting. You started a new <div> element all by yourself but then never closed it. So if you look you have a div tag and then the start of a new div inside that one. It wanted you to add the class to the div tags that were already there.

If you remove the two lines with the <div> and nothing else, and fix your indentation, your code should pass. Hope this helps! :sparkles:

Steffen Fylkesnes
Steffen Fylkesnes
1,208 Points

ahh, i see. thanks a bunch. guess i was supposed to edit the pre-existing divs, whereas the challenge led me to believe i was meant to add.

thanks for the quick answer, this was all i needed to finish up the track. :)