Home > database >  generate .txt from JS?
generate .txt from JS?

Time:08-21

Just a quick question:

Is there a possibility to capture via JS the information from a prompt or form to a file, for example .txt? And thus save on the hard disk the information generated by my page through the information entered by the user.

It is for a scoreboard of a board game.

If this is not possible... is there any other option? I had thought that maybe I could print screen and save image by means of a JS event.

Thank you very much!

CodePudding user response:

You have two options here:

  1. Create a file and then ask the user to download it
  2. Use File System Access API to save the file

How to create a file or even better

  • Related