title: Modal image with download link
body: <p>I have a modal image that when clicked, will open full-screen with the text displayed from the alt tag in the image. I grabbed the code off another site so need to change it to add a download link within the modal so when the link is clicked it will download a file. Is this possible in the below code?</p>
  
  <p>Code below:</p>
  
  <pre><code>    &lt;img id="myImg1" src="test.png" alt="Hello" width="95" height="146"&gt;
  
  &lt;!-- The Modal --&gt;
  &lt;script
  &lt;div id="myModal1" class="modal"&gt;
   &lt;span class="close"&gt;x&lt;/span&gt;
   &lt;img class="modal-content" id="img01"&gt;
  &lt;div id="caption"&gt;
  &lt;div id="caption1"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
  
  // Get the modal
  var modal = document.getElementById('myModal1');
  
  // Get the image and insert it inside the modal - use its "alt" text as a caption
  var img = document.getElementById('myImg1');
  var modalImg = document.getElementById("img01");
  var captionText = document.getElementById("caption1");
  img.onclick = function(){
  modal.style.display = "block";
  modalImg.src = this.src;
  captionText.innerHTML = this.alt;
  }
  
  // Get the &lt;span&gt; element that closes the modal
  var span = document.getElementsByClassName("close")[0];
  
  // When the user clicks on &lt;span&gt; (x), close the modal
  span.onclick = function() { 
  modal.style.display = "none";
  }
  
  // When the user clicks anywhere outside of the modal, close it
   window.onclick = function(event) {
      if (event.target == modal) {
          modal.style.display = "none";
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any assistance would be much appreciated.</p>