I want to update row data when user click on button but it updates all row of the table.
It updates all previous row when user click on another row's editbutton.
Each edit button with row is keeping the same class.
Sample Code
<table id="tablebody" class="table">
<tbody>
<tr>
<th>name</th>
<th class=""> Code</th>
</tr>
<tr>
<td>
<div class="form-control a medical_his" data-pk="medical_1" data-type="text">fffde</div>
</td>
<td>
<div class="form-control a hcode" data-pk="hcc_1" data-type="text">101</div>
</td>
<td style="border:none;">
<button class="editbtn btn btn-primary">Edit</button>
</td>
</tr>
<tr>
<td>
<div class="form-control a medical_his" data-pk="medical_2" data-type="text">fffdefds</div>
</td>
<td>
<div class="form-control a hcode" data-pk="hcc_2" data-type="text">fffdfasdddd</div>
</td>
<td style="border:none;">
<button class="editbtn btn btn-primary">Edit</button>
</td>
</tr>
</tbody>
</table>
Working Example jsfiddle
I want update a row which is clicked, not all previous clicked rows