JSFiddle - React, Tailwind, and code Playground

HTML

<a id="savex" download="x">click to save</a>

JavaScript

var saveButton = document.getElementById('savex');
saveButton.setAttribute('href-lang', 'text/plain');
var x = [];
var working = true;
for (var i = 0; i < 10; i++) {
  x.push((working ? '' : '#') + 'test' + i);
}
var content = x.join(' ');
saveButton.href = 'data:text/plain;utf8,' + content;