1
I want the script to count only tags <li>
which are visible, but the code below counts even with display:none
.
Is there anything that can do that?
I have the following HTML:
$( ".rodapeUlCat" ).append( $( "<li>" ) );
var n = $( ".rodapeUlCat li" ).length;
$( ".rodapeCat" ).text( " categorias( " + n + " )" );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="rodapeUlCat margin-top-25">
<li><h3><a href="/paginaSYS">tituloMenuSYS</a></h3></li>
<li><h3><a href="/paginaSYS">tituloMenuSYS</a></h3></li>
<li><h3><a href="/paginaSYS">tituloMenuSYS</a></h3></li>
<li style="display:none"><h3><a href="/paginaSYS">tituloMenuSYS</a></h3></li>
</ul>
<div class="rodapeCat"></div>