I user Tablesorter a jQuery plugin (I am sure other know about it) in my project. I need to add a feature where in when users click on a row, it gets selected . I tried the following code but, its not working out.
$('#myTable tr').click(function(event) {
$(this).addClass('selected');
});
Could anybody tell me the best way to do it? Is there any plug-in already for this?
Thanks in advance,
Abdel Olakara
I think that Tablesorter recreates the whole table so that could be why there is no change as it "destroys" the click event attached to the tr. You should try it using a live event and see if that works: Documentation for live events at jQuery.com