JQuery equivalent hide sequential elements

I am creating an application that should hide consecutive lines. I am currently using this:

#mytable tr.collpaserow + tr, #mytable tr.collpaserow + tr + tr, #mytable tr.collpaserow + tr + tr + tr { display: none; } 

This allows me to hide up to three lines in a row. I want to hide all possible consecutive lines regardless of depth using jQuery.

+4
source share
1 answer

Can you try this?

 $(".collpaserow").nextAll().hide(); 

http://api.jquery.com/nextAll/

+3
source

Source: https://habr.com/ru/post/1432169/


All Articles