Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <script> let link = document.createElement('a'); link.download = 'welcome.txt'; let blob = new Blob(['Welcome to W3Docs'], {type: 'text/plain'}); link.href = URL.createObjectURL(blob); link.click(); URL.revokeObjectURL(link.href); </script> </body> </html>