Find <a> with image extension in href (jQuery)
I need to find (开发者_JS百科and hide) all links with images (.jpg, .png, .gif) in href as they're causing my wordpress excerpts to break.
Many thanks.
$('a').filter(function() {
return $(this).attr('href').match(/\.(jpg|png|gif)/i);
}).hide();
Okay, figured it :P
$("a[href$='.jpg']").addClass('hide');
精彩评论