13/14 - I passed this step, but code doesn't work


#1

I passed this step, but code doesn't work, div.item doesn't removed :frowning: Why?
See screenshot http://prntscr.com/ajdcu3

$(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();    
    });
});

#2

Hi Oxojeck,

Your code works without any problems for me ¯\_(ツ)_/¯

After adding a list item, are you clicking on it to remove it?


#3

Wow, thanks. I thought that when I click on the button the .list is removing. :sunglasses:


#4