: Open Notepad , type your text, and go to File > Save As .
: Use the built-in open() function to write text and save it to your local directory. Download File pua6ftmin2or
const content = "Your text here"; const blob = new Blob([content], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'filename.txt'; a.click(); URL.revokeObjectURL(url); Use code with caution. Copied to clipboard : Open Notepad , type your text, and go to File > Save As
: Open TextEdit , ensure it is in "Plain Text" mode ( Format > Make Plain Text ), and save the file. : Open Notepad