12. Append to Body - what is wrong?


#1

Hello to everbody.

I my exercise I have written this code using jQuery:

$(document).ready(function()
{
$("#button").click(function()
{
var toAdd = $("input[name=checkListItem]").val();
$(".list").append('

' + toAdd +
'
');
});
});

the HTML code is:

when I click on "Save & Submit" button I receive this error message:

Oops, try again.
It looks like you're not appending a "

" + toAdd + "
" to .list.
Check the example in the instructions if you need help.

Can someone help me?


#2

You're forgetting to add it to the div, try this

$(document).ready(function() {
$('#button').click(function() {
var toAdd = $('input[name=checkListItem]').val();
$('.list').append('

' + toAdd + '
');
});
});

#3

Hi Heretic01libero,

Have a very close look at the end of line 6 :wink:

Hint

You're missing the > to close </div> :slightly_smiling: