更新时间:2023-11-29 17:01:40
var $ul = $('ul');
if($ul.find("li").length > 2 && $ul.find('.active, .inactive').length == 2) {
alert('yes, it is this way');
}
<ul>
<li class="active">Whatever</li>
<li class="inactive">Whatever</li>
<li>Whatever</li>
<li>Whatever</li>
</ul>