I have a table like this:
<table class="datatable" id="datatable">
<thead>
<tr>
<th>ID</th>
<th>Shopfront Product ID</th>
<th>Shopfront Product Name</th>
<th>Quantity</th>
<th>Base Price</th>
<th>Special Price</th>
<th>Start Date</th>
<th>End Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>11EA8E6B-346F-00B2-BCFE-023831B74848</td>
<td>Heineken Lager Sleek 330ml Can 24pk</td>
<td>1</td>
<td>2.99</td>
<td>1.99</td>
<td></td>
<td></td>
<td>
<button class="accept-btn">Accept</button>
</td>
</tr>
<tr>
<td>2</td>
<td>11EA8E6B-346F-00B2-BCFE-023831B74848</td>
<td>Heineken Lager Sleek 330ml Can 24pk</td>
<td>6</td>
<td>15.00</td>
<td>13.99</td>
<td>2020-05-31 00:00:00</td>
<td>2020-06-12 00:00:00</td>
<td>
<button class="accept-btn">Accept</button>
</td>
</tr>
<tr>
<td>3</td>
<td>11EA8E6B-346F-00B2-BCFE-023831B74848</td>
<td>Heineken Lager Sleek 330ml Can 24pk</td>
<td>24</td>
<td>37.00</td>
<td>35.00</td>
<td></td>
<td>2020-06-12 00:00:00</td>
<td>
<button class="accept-btn">Accept</button>
</td>
</tr>
</tbody>
</table>
Each row in table have a button to click, I want to get column Shopfront Product ID, Quantity, Special Price, Start Date, End Date value in which row button click. I tried this in Jquery:
$(".accept-btn").click(function() {
$(this).closest('tr').find('td').each(function() {
var textval = $(this).text();
console.log(textval.first);
});
});
But it give me all column data of clicked row. How I can just get specific column like I expected?
Thank you very much