$('td button').on('click', function (e) { var $button = $(this), buttonId = $button.attr('id'); var $tr = $button.closest('tr'), trId = $tr.attr('id'); var $textarea = $tr.find('textarea'), textareaValue = $textarea.val(); });
<tr id="16"> <td>Awesome</td> <td>S</td> <td>31-01-2019</td> <td><a class="btn btn-primary" href="ht.php?id=107&type=1">HT</a></td> <td><textarea id="t16" rows="3" cols="64"></textarea></td> <td><button id="b16"><img src="images/save.png"></button></td> </tr>