I have a simple table :
<table>
<tr>
<td>ID</td>
<td><a href="http:link" class="btn btn-default" data-action="view"
data-id="44">View</a>
</td>
</tr>
</table>
I would like after click get a data-action and data-id i tried
$('#visit-list-table tr').on('click', function() {
var test = $(this).closest("tr");
console.log(test[0].data('id'));
var test = $(this).closest("tr").find('a').attr('id');
console.log(test);
});
But without result. How can I get this data?