0 votes
asked in HTML by (4.2k points)

    I have a table. onchange of select variable, it generates rows. what i want to do is that, the data which i wrote in the first row, should be copied in the generated rows.

1 Answer

0 votes
answered by (8.2k points)

$("#mode").on('change', function () {
    var rows = parseInt(this.value);
    var lastRow;
    for (var i = 0; i < rows; i++) {
        lastRow = $('#engagements tr').last().clone();
        $('#engagements tr').last().after(lastRow);
Demo ----> http://jsfiddle.net/jW6eL/