Q:

jQuery: Select Images That are Linking to Image Files

How can I select images that are wrapped in  tags under the condition that the  tag href is to a gif, jpg, png, bmp, or some other image file type.
The reason I want to select these images is to add the overlay text "Click to Enlarge" to each image.

A:

Try this:
$('a[href$=".gif"], a[href$=".jpg"], a[href$=".png"], a[href$=".bmp"]').children('img');

The above selector is not case sensitive though, you might be better off selecting all links with images in them and filtering through them manually, like @reporter suggested.

