How to find table cell value that is clicked from ASP.NET MVC Page?
I am trying to find the find the Text of the Table cell (from TD) that is CLicked.
Basically, my JQuery Code is not htting this line.
$("#myTable tbody tr").find("td:eq(" + i + ")").click(function() {
My table has 88 Record开发者_C百科s when i tried $("#myTable tbody tr").length
But it is not find "td:eq(".
Appreciate all responses.
Did you mean $("#myTable tbody tr td").eq(i).click(function() { ? And $("#myTable td") is enough I think.
Try this:
$("#myTable tbody tr td").click(function(){
var clickedCell = $(this);
alert(clickedCell.text());
});
精彩评论