Find <a> with image extension in href (jQuery)

I need to find (and hide) all image links (.jpg, .png, .gif) in href since they cause wordpress fragments to break off.

Many thanks.

+3
source share
2 answers
$('a').filter(function() {
    return $(this).attr('href').match(/\.(jpg|png|gif)/i);
}).hide();
+13
source

Ok thought: P

$("a[href$='.jpg']").addClass('hide');
+3
source

Source: https://habr.com/ru/post/1724383/


All Articles