Question

I need to find (and hide) all links with images (.jpg, .png, .gif) in href as they're causing my wordpress excerpts to break.

Many thanks.

Was it helpful?

Solution

$('a').filter(function() {
    return $(this).attr('href').match(/\.(jpg|png|gif)/i);
}).hide();

OTHER TIPS

Okay, figured it :P

$("a[href$='.jpg']").addClass('hide');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top