I have a table and in that table I have given a button to user in first column of every row to delete the row and that delete button is dynamically generated when user enter the mouse on first column and this is the code
$('table').on('mouseover', "td.y-id", function () {
$(this).append($('<a class="dlt-x" style="float: right; cursor: pointer; cursor: hand;"> <i class="fa fa-trash"></i> </a>'));
});
$('table').on('mouseleave', "td.y-id", function () {
$('.dlt-x').remove();
});
and I registered an event to click of delete button like this
$('table').on('click', 'a.dlt-x', function () {
alert("clicked");
});
and this event is not triggering. I look other similar questions and try all the solutions find there related delegated binding but can't solve the problem.