Script error? Big problemo on "Append to body"

jquery

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

This is my code for this step, I've typed it in exactly how they want it done and it goes to the testing stage. It tells me to click the #button. The button however does absolutely nothing and merely says "script error". What is happening and how can I solve this problem.

Thank you in advance


#2

@king0fthec0de,

Please read
= http://discuss.codecademy.com/t/val-but-why/11772/2?u=leonhard_wettengmx_n


#3

@king0fthec0de on this line

var toAdd = $('checkListForm.val()');

you just need to close your parentheses before calling .val(), so it looks like this:

var toAdd = $('checkListForm').val();