title: jQuery/Javascript - Set click action on image based on it's src
body: <p>I have some images which I cannot add IDs or links to within the HTML. </p>
  
  <p>I am wondering if there is a way to write some script that applies a link to an image based on it's src. </p>
  
  <p>For example, </p>
  
  <p>If the image src is "<a href="http://www.my-image/img1.jpg" rel="nofollow noreferrer">http://www.my-image/img1.jpg</a>", link it to X.
  If the image src is "<a href="http://www.my-image/img2.jpg" rel="nofollow noreferrer">http://www.my-image/img2.jpg</a>", link it to Y.</p>
  
  <p>Hope someone can help. </p>
  
  <p>Thanks.</p>