Greetings to all. There is a html of approximately the following structure:
<div class="title"></div> <div class="block"> <div class="item"></div> <div class="item"></div> </div> <div class="title"></div> <div class="block"> <div class="item" style="display: none"></div> <div class="item" style="display: none"></div> <div class="item" style="display: none"></div> <div class="item"></div> </div> <div class="title"></div> <div class="block"> <div class="item" style="display: none"></div> <div class="item" style="display: none"></div> </div> Tell me how to make the blocks of the "title" class also display: none, if all the item is inside .block display: none (as if empty), and if at least one is visible, do not touch?
I tried using the .each () function to bypass .block, but inside .each () still does not work for .item.