title: jQuery Save Image Onclick
body: <p>On my website I have a jQuery script that, if the download button is clicked it will open the image that you want in new window.</p>
  
  <p>My question is, how can I make this script when you click the button the image will save automatically and not open in a new window.</p>
  
  <p>My code :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function (){
              $('#download-btn').click(function(){
                  var size = $('#size').val();                
                  window.open(size);
              });
          })
      &lt;/script&gt;
  </code></pre>