.parent().remove() issue

后端 未结 5 930
慢半拍i
慢半拍i 2021-01-01 18:26

I have a jQuery-based form where you can add extra people to the application. I\'m cloning the first fieldset and adding it onto the end up to a max of 3 additional people.

5条回答
  •  清酒与你
    2021-01-01 19:02

    Try:

    $(document).on('click', '.remove', function() {
        $(this).parent().remove();
    });
    

    Events are bound on page load so newly added element aren't.

提交回复
热议问题