//Images
var boxlinks = $('a[href]').filter('[href$=".png"], [href$=".gif"], [href$=".jpg"], [href$=".jpeg"]');
Is there a more efficient way to select multiple values of a single attribute with a filter in jQuery, here I am trying to select links only with an image as an href.
filter()can accept a method as its input. So in theory you could make a regex check against the href to see if it ends in any of the extensions. Or if possible, you could throw an 'image' class on all of them and call it a day.