Check and condition in jquery has selector

on with Leave a reply

$('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)')

Posted on by .

About Gowri

I am professional web developer with 8+ years experience. PHP, jQuery, WordPress, Angular and Ionic are my key skills in web development. I am working with strong enthusiastic team with spirit. We provide all web related solution like HTML/CSS development, Web graphic design and Logo.

Leave a Reply

Your email address will not be published. Required fields are marked *