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

I messed something up but can't figure it out

The code is not functioning properly; no element pops up. I inspected the page, and it tells me "Uncaught SyntaxError: missing ) after argument list app.js:16 " and yet I can't find anything missing...? Can I get some help? Maybe I'm just being blind, I don't know

$('#add-pet').on('click', function(){

//get info from form var $name = $('#pet-name'); var $species = $('#pet-species'); var $notes = $('#pet-notes');

var $newPet = $( // THIS IS LINE 16 '<section class = "six-columns"><div class = "card"><p><strong>Name:</strong> ' + name.val() + '</p><p><strong>Species:</strong>' + $species.val(); + '</p><p><strong>Notes:</strong>' + $notes.val(); + '</p><span class = "close">Ɨ</span></div></section>' );

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

I marked line 16, it's the one with var $newPet

Your name variable is missing a $ at the front.

$('#add-pet').on('click', function(){

//get info from form 
var $name = $('#pet-name'); 
var $species = $('#pet-species'); 
var $notes = $('#pet-notes');

var $newPet = $( '<section class = "six-columns"><div class = "card"><p><strong>Name:</strong> '  +  $name.val() + '</p><p><strong>Species:</strong>' + $species.val(); + '</p><p><strong>Notes:</strong>' + $notes.val(); + '</p><span class = "close">Ɨ</span></div></section>' );

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

});