There is ready-made javascript code that generates random passwords. Clicked on the button "generate password", a window opens with a password in the text field. How to make the password automatically saved to the buffer when the window is closed?

    1 answer 1

    On pure JavaScript, working with the clipboard will not work. You need Flash (for example, this library). Closing a window can be caught by the window.onbeforeunload event.