jQuery: exclude class on click

Posted by Kevin Brown on Stack Overflow See other posts from Stack Overflow or by Kevin Brown
Published on 2010-12-22T19:47:16Z Indexed on 2010/12/22 19:54 UTC
Read the original article Hit count: 195

Filed under:
//Table select
$("#reports-table tr").click(
    function() {
        var detail_id = $(this).attr('id');
        $(this).addClass("selected");
        $(this).siblings().removeClass("selected");
        $('#reports-right').show().load('/members/details/'+detail_id);
        $('#reports-table').width(680);
    }
);

I currently am using this code to add a selected class to a table row and show details of the row clicked in a right 'aside'. The problem is, I have action buttons in the row--when they are clicked, becausee they are children of the tr, this function still runs...

How can I exclude a certain class?

© Stack Overflow or respective owner

Related posts about jQuery