jQuery Clone table row

前端 未结 7 1154
悲&欢浪女
悲&欢浪女 2020-11-30 03:56

I have a table with an Add button on the end. When you click this button I want a new table row to be created underneath the current one. I also want the input fields on thi

7条回答
  •  清歌不尽
    2020-11-30 04:27

    Try this.

    HTML

    
    
    Name Location From To Add

    Script

    $("input.tr_clone_add").live('click', function(){
        var new_row = $("#new-row-model tbody").clone();
        $("#table-data tbody").append(new_row.html());
    });
    

提交回复
热议问题