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 Introduction to jQuery DOM Manipulation Adding Content to the Page

what am I putting in that is different????

this is going to drive me crazy....

this is the event handler I am creating:

$('#add-pet').on('click', function() { var $name = $('#pet-name').var(); var $species = $('#pet-species').var(); var $notes = $('#pet-notes').var(); var $newPet = $( '<section class="six columns"><div class="card"><p><strong>Name:</strong> ' + $name + '</p><p><strong>Species:</strong> ' + $species +
'</p><p><strong>Notes:</strong> ' + $notes + '</p><span class="close">Ɨ</span></div></section>'
);

$('#posted-pets').append($newPet);

});

why is it not working?

1 Answer

nevermind. I was putting var instead of val