I have table in my view
Here is code
<tbody id="findings" style="overflow-y: scroll;">
@foreach (var item in Model) {
<tr>
<td style="display: none" id="patientId" class="title">
@Html.DisplayFor(modelItem => item.Patient_id)
</td>
<td class="title appdate">
@Html.DisplayFor(modelItem => item.Start_appointment)
</td>
<td id="nameVal" class="title">
@Html.DisplayFor(modelItem => item.Patient.Name)
</td>
<td class="title">
<img src="@item.Calculation.CalculationStatus" />
</td>
<td class="title">
<img style="width: 30px; height: 30px;" class="open_calculation" src="~/images/icons8-Document-30.png" />
</td>
</tr>
}
</tbody>
I need to get value from
<td class="title appdate">
@Html.DisplayFor(modelItem => item.Start_appointment)
</td>
via button click open_calculation
How I can do this correctly via js?
Thank's for help.
click(),closest(),find(),text()var date = $(this).find("tr").closest('.appdate').text();? @RoryMcCrossanclickevent handler.thisis atd. open_calculationyou'll need to use something like$(this).parent("tr").find(".appdate").text().