Finished the section but the code doesn't do anything!


#1



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

I don't understand what the problem is here. Everything seems to be fine but when testing the code, it doesn't do anything. I can't add items or remove them. I appreciate anyone helping here.


#3

Hi Hamid,

'<div class='item'>'

You can't put single quotes inside of single quotes (') like that. Wrap item in double quotes (") instead.


#4

Thanks, the quotes were the problem :smile:


#5