Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

111
Views
How can I add localStorage and Json(parse, stringify) to my JS project?

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.

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

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. enter image description here

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs