[jQuery] Re: Getting index of clicked table cell

2009-04-14 Thread MorningZ
Thomas: Thanks! a big "doh!" for me for missing the fact that i wasn't selecting table cells to find the cell clicked. works like a charm now.. .thanks

[jQuery] Re: Getting index of clicked table cell

2009-04-14 Thread Tony
Upps, sorry mixed some code. $("#Table1 tr.SUM").click(function(e) { var td = e.target || e.srcElement alert(td.cellIndex); }); On Apr 14, 2:11 pm, Tony wrote: > Hello, > IMHO this can be: > $("#Table1 tr.SUM").click(function(e) { >       alert(this.rowIndex); > > }); > > Regards >

[jQuery] Re: Getting index of clicked table cell

2009-04-14 Thread Tony
Hello, IMHO this can be: $("#Table1 tr.SUM").click(function(e) { alert(this.rowIndex); }); Regards Tony On Apr 14, 1:46 pm, Thomas wrote: > Wow, you had me stumped for a couple of minutes there. :) > > I think the .index() method doesn't do what you want it to do. > > As I understand it,

[jQuery] Re: Getting index of clicked table cell

2009-04-14 Thread Thomas
Wow, you had me stumped for a couple of minutes there. :) I think the .index() method doesn't do what you want it to do. As I understand it, you use that method on a selection of elements, pass it an element, and it will search for the element in that selection. So if you did alert($('td', th