Hello, I have a table, in it an IDName column, I need to click on the row to pull out the IDName value and pass this value to the controller.
<table id="example"> <thead> <tr> <th> IDClaim </th> <th> IDname </th> <th> Текущая задача </th> <th> Дата старта </th> </tr> </thead> @foreach (var item in Model) { <tr> <td> @Html .DisplayFor(modelItem => item.IDClaim) </td> <td id="IDName"> @Html .DisplayFor(modelItem => item.IDName) </td> <td style="text-align:left" id="Content"> @Html .DisplayFor(modelItem => item.Content) </td> <td> @Html .DisplayFor(modelItem => item.StartDate) </td> </tr> } </table> ______ <script> $(document).ready(function() ``{ $('#example tbody tr').live('click', function () ``{ var nTds = $('td', this); var sClaim = $(nTds[1]).text(); alert(sClaim) }); }); </script>
Hike, I did something wrong) Thanks in advance!