Skip to content Skip to sidebar Skip to footer

Hide/show Table Rows With A Specific Class Until Another Row With A Different Class Name?

I have rows I want to show and hide, but only up until the next first-level row. My code is toggling all of the second-level rows instead of the ones up until the next first-level

Solution 1:

You need to start at the element clicked:

$('.first-level').click(function() {
    $(this).nextUntil('.first-level').toggle("slow");       
});

Passing in the whole collection just won't work as there is no single point of reference to start from

DEMO

Post a Comment for "Hide/show Table Rows With A Specific Class Until Another Row With A Different Class Name?"