Hello,
If I have a bunch of links to an image like this:
<a href="foo.png">foo.png</a> <a href="foo.jpg">foo.jpg</a> <a href="foo.gif">foo.gif</a>
How would I find it all with js and then add a class?
This is what I was thinking but that didn't work:
$('a[href*=.png]').addClass('image-link');
$('a[href*=.jpg]').addClass('image-link');
$('a[href*=.gif]').addClass('image-link');
UPDATE: There was a typo in my js. The above works.