Password Saver help HTML + local.Storage

I Have a password saver in html, but i just want it to save. this does it, but then how do i view those passwords?

the code is in the link above, and there is a script.js too.

To save a string to local storage, you can use:

window.localStorage.setItem("name", "value");

To get that string again, you can use:


Why are you prepending window.? I thought it wasn’t necessary.

It isn’t really, it’s a personal preference, but localStorage does belong to the window object. In the browser, global variables technically belong to the window object:

var test = 123; // note let and const are local variables (and you shouldn't ever be using var)