JSFiddle - React, Tailwind, and code Playground

JavaScript

$('<a href="data:text/plain,Test" download="test.txt">')[0].click()