M
M
MisTFoR2021-07-11 00:58:06
JavaScript
MisTFoR, 2021-07-11 00:58:06

How to add a function - checking the presence of "display: block" for all elements?

Hello!
I have this html code:

<div class="wrap">
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
    <div class="item-wrap"></div>
</div>
<a href="#" class="show_more">Текст</a>

I need a function that checks for all blocks style="display: block"except the first 8.
If all blocks have "display: block" (except the first 8 of course) then the ".show_more" button disappears.

Many thanks in advance =)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question