Hello,
I want to get all links that point to an image. Is there an easier way than the following?
$("a[href$=.jpg],a[href$=.jpeg],a[href$=.png]");
Thanks Jean
Hello,
I want to get all links that point to an image. Is there an easier way than the following?
$("a[href$=.jpg],a[href$=.jpeg],a[href$=.png]");
Thanks Jean
You can use the .filter function:
$('a').filter(function() {
return /\.(png|gif|jpg|jpeg)$/i.test(this.href);
});