views:

40

answers:

2

Hey Guys,

I want to round up all images that have a specific attribute and place. My images look like this:

<img src='http...' border=3 class=grid_pic>

And here is my attempt:

$('.grid_pic:has(border=3)').each(function(){alert(1);}); 

But the alert doesn't shout. If I remove the has:border/has:border=3, it shouts.

Any ideas?

+2  A: 

Write it like that:

[attribute=value]   $(’[rel=external]‘);

Example:

$('.grid_pic[border=3]').each(function(){alert(1);}); 
Amr ElGarhy
@Max Shawabkeh thanks for editing my answer, it must be without space before the attribute.
Amr ElGarhy
+2  A: 

$('.grid_pic[border=3]').each(function(){alert(1);});

Blair McMillan