$('table#foo tbody td:nth-child(3)').addClass('hover');
Use this script (note that using: nth-child is the selector index of each child that matches, starting at 1)
$(".legendvalue", ".stmatst_legends").hover(function() { var index = $('.legendvalue').index($(this)); $('table#stmstat tbody td:nth-child(' + (index + 1) + ')').addClass('hover'); }, function() {
source share