0

Hi I am trying to use jQuery to select all elements which have the class of "icon" which do not contain a particular image (to turn them off for filtering content)

I could do something like the example below, but it would seem like there would be a much cleaner way to select all elements that don't contain that image src to hide them.

Thank you for your feedback!

$('.icon').hide();
$('.icon').find('img[src$="'+src+'"]').parent().parent().show();
4

1 回答 1

0

$('.icon').find('img[src !="'+src+'"]').hide();可能工作

于 2012-08-13T23:45:14.090 回答