I'm trying to get the first value of the row in my html table when I click in each delete button...
The table is populated from SQL database...
the image below!
I will put only the necessary code:
HTML Button:
<button type="button" class="btn btn-danger btn_delete" id="btn_delete" onclick="delete_function()">Delete</button>
Javascript Code:
<script type="text/javascript">
function delete_function() {
var id = $('#clients tbody').find('td:first').text();
alert(id);
}
</script>
If I click in any button I always receive the alert with same result:
114
How I can get the same id number value that exist in the same line of the button clicked??? I accept Javascript and Jquery advices