[jQuery] Re: Getting data from the corresponding column. (HTML Table with thead and tbody section.)

2009-02-12 Thread Mark Tomlin
To make this example more readable, and to better convey my goal, I've restructured the CSS and HTML. Only the green area is click able (as it should be, the red area does not have a bound click even for a reason). When I click any part of the green area, I would like to get the value from the

[jQuery] Re: Getting data from the corresponding column. (HTML Table with thead and tbody section.)

2009-02-12 Thread mkmanning
Hmm, the group went offline seconds after I posted; I swear it wasn't my fault :P, so sorry if this appears twice; Try this: $(document).ready(function() { $(tbody td).click(function(e) { var index = $(this).parent().children().index(this); alert(

[jQuery] Re: Getting data from the corresponding column. (HTML Table with thead and tbody section.)

2009-02-12 Thread mkmanning
Here's one way: $(document).ready(function() { $(tbody td).click(function(e) { var index = $(this).parent().children().index(this); alert( $(this).parents('tbody').prev().find('tr').children(':eq ('+index+')').text() ); }); $(tbody