title: jquery or html to download image onclick or with link
body: <p>I have an image that I want the user to click on to be able to download ( save it ).</p>
  
  <p>When currently clicked, the download box pops up with the image.jpg tag and lets the user save it.</p>
  
  <p>I am using HTML:</p>
  
  <pre><code>&lt;a href="folio/1.jpg" download&gt;&lt;img src="folio/1.jpg"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>This works well, but I have a lot of images, is there a way to use jQuery to do something like </p>
  
  <pre><code>jQuery(function($){
  $("a").prop("href", "(this)")
  });
  </code></pre>
  
  <p>to download the image without having to type it in twice so it looks like this:</p>
  
  <pre><code>&lt;a href="" download&gt;&lt;img src="folio/1.jpg"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I am trying to simplify the coding to make it easy to click on the image to 
  download it rather than to have to right click to save it.</p>
  
  <p>Thanks for your help.</p>