I have a table containing 3 columns. I need to bind an event that fires every time I click on one of these columns using jQuery.
However, I need to know the index of the clicked column.
ie: First column (index 0), Second column (index 1), Third column (index 2), etc ...
How can i do this?
var firstRow:
var firstRow = $("tr:first > th", "table[id*=Grid]");
Take a look:
firstrow.click(function(e){
var id = $(e).parent().children().index(this);
})
source
share