开发者

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());
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜