If this contains that change CSS of another element : I have a percent bar that need to change your width when a element appears.
I tried use .has but :contains is more correct I think. But does't work. Some idea how to do this work?


    var animals = [ 'Lion', 'Cat', 'Tiger', 'Dog' ]
    var box_animals = animals.valueOf; 
    
   

     if ("box_animals:contains(Cat)"){
            $("#ruler_bar").css("width", 2% );
      }
        if ("box_animals:contains(Lion)"){
            $("#ruler_bar").css("width", 50% );
      }

  


