$(function(){
var count = '';
var total = 1;
$('ul li').each(function(index, el) {
count++;
if(count == 12) {
total + 1;
}
count = '';
});
console.log('Se encontraron 2 UL con 2 li');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li>Item</li>
</ul>
<ul>
<li>Item</li>
</ul>
<ul>
<li>Item</li>
<li>Item</li>
</ul>
<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
<ul>
<li>Item</li>
<li>Item</li>
</ul>
I have UL and I need to know of all the existing UL, how many UL have 2 LI, what I'm trying to do with each one, this will be the right way.
2 UL were found with 2 li
I would greatly appreciate your help.