Reputation: 75650
How do I select all <div> elements which do not contain any <img> elements using jQuery?
<div>
<img>
Upvotes: 7
Views: 4308
Reputation: 1
$(".className").not(":has(img)")
Upvotes: 0
Reputation: 124778
$('div:not(:has(img))')
Upvotes: 19