Get table id by click in td using jQuery
In the click handler you can use .closest()
$(this).closest('table').attr('id')
$("#tableID").on("click","input[type='text']",function(){
$(this).closest('table').attr('id');
});
reference closest()
You should delegate event to avoid multiple handlers, and then use delegateTarget
to target current TABLE:
$('table').on('click', 'input', function (e) {
alert(e.delegateTarget.id);
});