I have been trying to use jQuery on this code but it is not responsive. I dynamically try to add some rows to the end of an HTML table and I have also included a cancel button. The click function on the cancel button doesn't seem to work.
I can't post full code here, so I included a link to the jsFiddle.
Part of JavaScript code:
$('#myTable tbody:last').after('<tbody class="newrow"><tr><td> <input type="text" class="app"></td><td><input type="text" class="env"> |\n\
</td><td><input type="text" class="region"> | </td><td><input type="text" class="url"> | \n\
</td><td><button class="cancel">X</button></td>\n\
</tr></tbody>');
}
$('.cancel').on('click', function() {
alert();
//$(this).closest('tbody').fadeOut(2000);
});