Let’s say I have,
<div>
<img src='aaBB_a.png' />
</div>
<div>
<img src='aaa_a.png' />
</div>
<div>
<img src='aaBB_a.png' />
</div>
I need to select all div’s (not images) which contain a img child which src contain BB_. In above example, I need to select first and third(not second). I have tried this,
'div img[src*="BB_"]',
But it is selecting images not div.
Update: I need to pass this to jquery delegate,
$(‘#container’).delegate(‘div img[src*=”BB_”]’,’mouseover’,function(){
})
Use jQuery
has()to filter the initial result to those that has these descendantsFor the selector version
:has():