Using Jquery, replace one row in table with a new one

前端 未结 4 1184
忘掉有多难
忘掉有多难 2021-02-08 05:09

Say I have a table:

'
        tr.replaceWith(new_row); // code to replace this row with the new_row
    });
} );

提交回复
热议问题
12Edit
4条回答
  •  面向向阳花
    2021-02-08 05:47

    jQuery's replaceWith(). Example:

    $(document).ready(function() {
        $('#mytable .edit').click( function() {
    
            var tr = $(this).parent();
            var new_row = '
34Save