JSFiddle - React, Tailwind, and code Playground

by abigwonderful

HTML

<a href="/music/somefile.mp3" download="somefile.mp3">Download mp3</a>
<div id="download"></div>

JavaScript

var a = document.createElement('a');
if (typeof a.download == "undefined") {
    //append some text to inform the user 
    //they should right-click the link to download
    //example:
    var downloadDiv = document.getElementById('download');
    downloadDiv.innerHTML = "Right-click the link and select 'Save as...' to download the mp3";

}