JSFiddle - React, Tailwind, and code Playground

HTML

<div id="container">
<div style="display:none">
    <div></div>
    <div style="display:none"></div>
</div>
    
<b>Result:</b> <span id="result"></span>
</div>

JavaScript

$("#result").html(
    (
        $("#container div")
        .filter(function(){
            return $(this).css("display") == "none";
        }).find("> div").filter(function() {
            return $(this).css("display") != "none";
        }).length
    ).toString()
)