Read .on()
As elements are added dynamically you can not bind events directly to them .So you have to use Event Delegation.
$('#datatable').on('click', 'tbody td a', function (e) {});
Syntax
$( elements ).on( events, selector, data, handler );
Below code is not Event Delegation
$('#datatable tbody td a').on('click', function (e) {