[Solved] Replacing live with on function [closed]

[ad_1]

You missed the selector parameter that allows you to use delegated events.

$(document).on('click', '#remove', function() {
    $(this).closest('div.container').remove();
});

Where document can be replaced by any #remove container that exists at binding time

[ad_2]

solved Replacing live with on function [closed]