jQuery cannot recognize appended cloned elements using jQuery.appendTo()

后端 未结 3 1846
一生所求
一生所求 2021-01-20 06:04

I want to make a list of group inputs allow user to dynamically let user add/remove group row:

3条回答
  •  心在旅途
    2021-01-20 06:46

    Add 'true' to the clone method in order to copy the data as well as the events attached to the original element.

    rowTemplate = j('.form-denomination:first-child').clone(true);
    

    This is disabled by default. Here is the clone documentation: https://api.jquery.com/clone/

    P.s. You don't need the click function within the document.ready and it won't bind until after the click.

提交回复
热议问题