12/14 Append to body


#1

Hello!

Here's my code for this exercise:

$(document).ready(function() {
    $("#button").click(function() {
        var toAdd = $("input[name=checkListItem]").val();
        $('.list').append('<div class = "item">' + toAdd + '</div>');
    )};
});

It lets me go on to the next exercise, but I can't click the 'Add' button to add anything to my list and it says "Uncaught SyntaxError: Unexpected token )".

For once I can't find anything in the forum to guide me in the right direction.

Does anyone know what's wrong here?

Many thanks in advance for your help,
Karin


#2

Oh dear, nevermind!

I just needed to switch )}; to }); !

Silly, sorry about that!