I'm working on a random password generator app using JavaScript. I want to add localStorage to store the passwords that were generated but have no idea on how to do it.
I've tried using a localStorage.setItem and localStorage.getItem but I cannot get it working.
I would really appreciate if someone could give me a hand , I'll leave the JS code down below.
Thanks.
I want to add localStorage to store the passwords that were generated
Your code is correct. When you click on "copiar" button, the click event handler is called which stores the password to localStorage. If you are using Chrome, you can check the Application tab in Chrome Dev tools to check that it is being stored.