13/14 code is approved but not functioning properly


#1



The compiler says my code is correct, but it doesn't seem to be performing the function and actually removing the 'item'.


$(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

item is a class selector so needs the dot.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.