note : firstly i select the row and below code will be used to fetch id
var allocationid = $(this).parents("tr").children("td").eq(0).text();
my jquery code .. using eq .
but i dont want to use eq . i want in dynamic way. fetch with the help of column name
//table format table has thead and tbody tag
<table>
<thead>
<tr>
<th>ID</th>
<th>name</th>
</tr><br>
<thead>
<tbody>
<tr>
<td>01</td>
<td>joe</td>
</tr>
</tbody>
</table>
let colName_NPDId = 'NPDId';
let index1 = $(this).closest("table").find(`thead tr th:contains(${colName_NPDId})`).index();
let npdid = $(this).closest("tr").children("td").eq(index1).text();
this code I Used (reference of this comment) but this code fetch value of hidden column only(jqgrid). please help me out