12. Append To Body


Hi all,

I’m getting a pass for my code below on exercise 12, but it’s not actually doing anything when I click the Add button.

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

I think the code is probably wrong, but I can’t see how. Can anyone help me with it please?



I’d missed off a concatenation + from the 4th line, but now it’s just adding [object Object] to the list, so another problem!


@devblaster44527 Good catch - now all you need to do is grab the **val**ue of the input field :wink:


Like this:



Doh! Of course. All working now. Thank you!