JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<body>
<center>
<script>
function onDownload()
{
document.location = 'data:text/attachment; filename="base.txt",' + 'information' ;
}
</script>
<a href="javascript:onDownload();">Download</a>
</center>
</body>
</head>
</html>