开发者

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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜