title: Download button
body: <p>I am making an audio player, and I would like to include a button that downloads the current track. I have tried the common solutions people suggest, but these only open the .mp3 in a new tab and play it. This is what I am using:</p>
  
  <pre><code>document.getElementById("dlButton").addEventListener("click", function(){
  window.location = "tracks/CFKZ.mp3";});
  </code></pre>
  
  <p>I saw another solution <a href="https://stackoverflow.com/questions/11620698/how-to-trigger-a-file-download-when-clicking-an-html-button-or-javascript/" title="here">here</a> on stack overflow:</p>
  
  <pre><code>&lt;form method="get" action="file.doc"&gt;
  &lt;button type="submit"&gt;Download!&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I don't understand this. It doesn't make sense to me why a download button would need to send information to the file that is to be downloaded.</p>