You can do this using the .closest()following:
$("a.ilink").click(function() {
$(this).closest("tr").addClass("highlight");
});
If you have many lines, this will be more efficient (one copy of this compared to one for each <a>):
$("table").delegate("a.ilink", "click", function(){
$(this).closest("tr").addClass("highlight");
});
source
share