Remove What's Been Clicked and the second button 'remove'


#1


I went one step further and...
I've added to html another button named 'button1' . I want this button to remove 'item'.
I created a code to it, but it appears that button1 still doesn't react.
Anyone can see a solution?


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


#2

If you wish to get help with a lesson, then don't take liberties and then expect help with your exploration. That is disruptive to this topic category. Do the lesson as instructed so that you can expect to pass.

For further exploration, please post your topic in the Corner Bar where your ideas may be freely discussed and explored without disrupting this category.


#3

I actually think that is a great idea. Sadly that is not a part of the lesson. So long as you already did the code to pass the lesson, I do like the fact that you want to go above and beyond. I will actually try to figure out how to do that.

This isn't exactly the place to post this topic though, please post this topic in the Corner Bar as mtf said,


#4

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