jQuery has method
If we need to filter a set by elements that have certain descendants, we can use the has method:
For example, let's say we have the following HTML code:
<p>text</p>
<p>text</p>
<p><b>bold</b> text</p>
<p><b>bold</b> text</p>
Let's select only those paragraphs that have the tag b inside and put the text '???' at the end of them:
$('p').has('b').append('???');
Find those li in the set that have a i tag inside and color them red.