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 trialSarah Pellecchia
Courses Plus Student 2,335 PointsI cant figure out what is wrong here. please help!
Ive looked at it a dozen times. not sure what im missing.
<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>
3 Answers
doesitmatter
12,885 PointsWell I see you passed task 1 which was to add a class attribute to the divs. Task 2 is the same idea, only now you add the name attribute, with the value text, to all the input tags. So you add: type="text" to the input fields.
EDIT: I see now that you have the div opening tag twice, you needn't create another div within the div, just add the class property to the first div, so it should be:
<div class="favorite_stuff">
<h4>Favorite Foods?</h4>
<input name="food[]">
<input name="food[]">
<input name="food[]">
<input name="food[]">
</div>
Bogdan Cabaj
16,349 PointsHi Sarah,
Below html worked for me. Your class entries are correct. For challenge 2 we need type="text" for each input tag.
'''HTML <body> <h1>First Day of School</h1>
<form>
<div class="favorite_stuff">
<h4>Favorite Foods?</h4>
<input name="food[]" type="text">
<input name="food[]" type="text">
<input name="food[]" type="text">
<input name="food[]" type="text">
</div>
<div class="favorite_stuff">
<h4>Favorite Animals?</h4>
<input name="animal[]" type="text">
<input name="animal[]" type="text">
<input name="animal[]" type="text">
<input name="animal[]" type="text">
</div>
</form>
</body> '''
Sarah Pellecchia
Courses Plus Student 2,335 Pointsthanks everyone. The hint they gave me confused me instead of helping me! :)
Ryan Fox
4,971 PointsRyan Fox
4,971 PointsIn the initial challenge, they have divs that wrap the input tags. You shouldn't need to write in your own to pass the challenge. You're correct writing them here, but the challenge wants them on the given div blocks :)
Hope this helps!