JavaScript関数(jQuery)で「StudentID」値にアクセスするにはどうすればよいですか。
HTML:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Student.Models.vwStudent>>" %>
<div class="divClass" id="divID">
<table class="tableClass" id="tableID">
<% foreach (var item in Model) { %>
<tr class="trClass" id="trID">
<td class="tdClass">
<%= Html.TextBox("StudentID") %>
</td>
<td class="tdClass">
<%= Html.Encode(item.StudentName) %>
</td>
</tr>
<% } %>
</table>
</div>
JQuery:
$('#ShowStudentID').click(function () {
$(".tdClass").each(function () {
alert($('.tdClass').children().val());
// How do I access StudentID and StudentName here?
});
});