0

I have this code

$('.bodyContent_2ndTier_RHS img, .industriesArticle_mainWrapper img, .blog img , .blogpostLHS img').attr('src', function(_, src) {
return src.replace(/(\.\w+$)/, '@2x$1');
}

But I want this to only be executed if the attr src DOES NOT ALREADY include @2x.

Please advise on how to achieve this

dubbs
  • 1,167
  • 2
  • 13
  • 34

0 Answers0