- The read-only local-storage property allows you to access a Storage object for the Document's origin;
- The stored data is saved across browser sessions.
- local-storage is similar to session-storage, except that while data stored in local-storage has no expiration time, data stored in session-storage gets cleared when the page session ends — that is, when the page is closed.
//Use local storage to store items var localStore=window.localStorage; localStore.setItem('userId','1'); localStore.setItem('pwd','1234')
Remove data from the storage object
console.log("***\n Remove data from the local storage object"); localStore.removeItem('userId'); localStore.removeItem('pwd')
No comments:
Post a Comment