function download(content, filename, contentType) { if (!contentType) contentType = "application/octet-stream"; var a = document.createElement("a"); var blob = new Blob([content], { type: contentType }); a.href = window.URL.createObjectURL(blob); a.download = filename; a.click(); } download(csvContent, 'listSimulationRunTimes.csv', 'text/csv');
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter