tags:

views:

63

answers:

2
+2  Q: 

Jquery, Links

I need to select with jQuery <a href=""> , but only 'href' with extentions '.JPG' or '.jpg'

for example :

to find only this 'links'

<a target="_blank" href="images/test.jpg" class="highslide ">
   <img src="images/test.jpg" alt='img'/>
</a>

<a target="_blank" href="images/test.JPG" class="highslide ">
   <img src="images/test.JPG" alt='img'/>
</a>

but not this

<a target="_blank" href="galery.html" class="highslide ">
   <img src="images/test.JPG" alt='img'/>
</a>

thank You !!

+2  A: 
$("a[href$='.jpg']")

See Selectors/attributeEndsWith in the jQuery documentation.

RichieHindle
it works !! thanks You
Alexander Corotchi
+4  A: 
$("a[href$=.jpg], a[href$=.JPG]")...
cletus
thank You !!
Alexander Corotchi