views:

47

answers:

2

Hi

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 Records when i tried $("#myTable tbody tr").length

But it is not find "td:eq(".

Appreciate all responses.

+1  A: 

Did you mean $("#myTable tbody tr td").eq(i).click(function() { ? And $("#myTable td") is enough I think.

queen3
This also works.... Thanks queen3
Rita
A: 

Try this:

$("#myTable tbody tr td").click(function(){
  var clickedCell = $(this);
  alert(clickedCell.text());
});
Jon
This works. Thanks Jon.
Rita