<ul class="list">
  <li class="active">text</li>
  <li>text2</li>
  <li>text3</li>
</ul>

<ul class="list">
  <li >text</li>
  <li>text2</li>
  <li>text3</li>
</ul>

<ul class="list">
  <li >text</li>
  <li class="active">text2</li>
  <li>text3</li>
</ul>
let $parents = $('.list');
$parents.each(
    function(){
      var $el = $(this);
      if($el.find('.active').length !=0){
         $el.css('background', 'red');
      }
    }
);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js