Guest User

Untitled

a guest
Jul 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. window.insertBatchRow = function() {
  2. var $table = $('#myTable');
  3. var $last = $('tr:last', $table);
  4.  
  5. // Remove all data from the clone
  6. var $new = $last.clone();
  7. $('td', $new).each((index, td) => {
  8. $(td).children().first().val('');
  9. });
  10.  
  11. // Insert the new, blank row at the end of the table
  12. $last.after($new);
  13. }
Add Comment
Please, Sign In to add comment