I insert new row by clone of one of the rows, but I noticed that it does not respond to events like (click, change)
I used this code, but unfortunately it doesn't add events to it:
$('#input1 ,#newid').change(function () {
console.log('here');
})
function copy()
{
var $LastRow = $('#table tbody tr:last').clone(true);
var $inputs = $LastRow.find('td').children();
$inputs.attr('id', 'newid');
var Table = $('#table tbody');
Table.append($LastRow);
}
<table id="table">
<tr>
<td>
<input id="input1" />
</td>
</tr>
</table>
<button onclick="copy()"> ok</button>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>