I have a table in which each tr is a record and each td is a column. When I use the click event and click on tr, I need both tr id and the 6th column td id.
Both tr and td id should be assigned to a variable.
How to do this with a jQuery selector?
Is this correct?
$(‘tr td).(‘click’, function (
{
});
Any help would be be appreciated. I tried this too:
$('tr td:nth-child(5)')
… but it didn’t work.
HTML:
jQuery:
See jsFiddle. (NOTE: The
class="sixth"but was just for debugging and display purposes in jsFiddle.NOTE: Revised solution after question was clarified by OP: jsFiddle