title: set download attribute on dynamically displayed image
body: <p>I'm displaying a long list of images from a site on a page with the below code. Id like to be able to use the download <code>HTML5</code> attribute so that click each image will download it. </p>
  
  <p>Here's what I've tried:</p>
  
  <pre><code>for (var i = 0; i&lt;arlnData.d.length;i++) {
          var img = document.createElement('img');
          img.src = "https://images.website.com/airvendors/airlines_"+arlnData.d[i].Code+".gif"; 
          img.download ="my image"; 
  
          //also tried: 
          //img.src = "https://images.website.com/airvendors/airlines_"+arlnData.d[i].Code+".gif";
          document.body.appendChild(img);
  
          var imageCellspace=document.createElement('br');
          document.body.appendChild(imageCellspace);
  }
  </code></pre>
  
  <p>Images are displayed fine but clicking to download doesnt work.</p>
  
  <p>What is the proper syntax here?</p>