$('p:has(img)')
will select the p tags that has image inside it. Now think you want to add another condition to select p tags that contains iframe. It’s also very simple :has supports comma selection.
$('p:has(img,iframe)')
$('p:has(img)')
will select the p tags that has image inside it. Now think you want to add another condition to select p tags that contains iframe. It’s also very simple :has supports comma selection.
$('p:has(img,iframe)')