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

Karen Machin
Karen Machin
1,449 Points

Don"t know what I"m doing wrong/omitting in this coding challenge :

Challenge Task 1 of 2

We want the same CSS style to apply to both <div> elements. Give both <div> elements the class of "favorite_stuff". Hint: The syntax for giving a <div> a class looks like this: <div class="favorite_stuff">

Emmanuel Plouvier
Emmanuel Plouvier
11,919 Points

Hi,

Can you post your code ?

thanks :)

4 Answers

Emmanuel Plouvier
Emmanuel Plouvier
11,919 Points

You don't have to duplicate open div tag ;)

try that :

<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>
Karen Machin
Karen Machin
1,449 Points

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

Karen Machin
Karen Machin
1,449 Points

Thank you...when I tried this it gives me this response: Bummer! The class attribute on your second <div> element needs to be set to "favorite_stuff". Make sure it's all lower case, and that you have an underscore character in the middle.

Karen Machin
Karen Machin
1,449 Points

okay! no don't worry....I finally "got" what you were saying :-) and it worked. thanks SO much