Why doesn't it work? Please help

jquery

#1

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

' + toAdd + '
');
);
$(document).on('click', '.list', function(){
$(this).remove();
});
});

#2

Hi Goduras,

I think you're missing function() { at the end of line 2, and then line 5 needs to be });. If fixing that doesn't pass you, could you please let me know which exercise you're on? Thanks :)


#3

$(document).ready(function() {
$('#button').click(function() {
var aAjouter = $('input:text').val();
$('.list').append('

'+aAjouter+'

');
});
});

Code works but CodeCademy replys an error !


#4

@pycoder51098

This won't work, and isn't what the exercise wants. @goduras Had the correct code for that part.


Next time (or if you need more help this time), create a new topic instead of reviving a four month old one.


#5