Answers for "How to use localStorage javascript"

28

Javascript store in localStorage

var person = { "name": "billy", "age": 23};

localStorage.setItem('person', JSON.stringify(person)); //stringify object and store
var retrievedPerson = JSON.parse(localStorage.getItem('person')); //retrieve the object
Posted by: Guest on July-22-2019
4

javascript get local storage

var Item = localStorage.getItem('youritem');
Posted by: Guest on February-22-2020
5

javascript localstorage

localStorage.setItem("user_name", "Bob");

document.body.addEventListener("click", function(){
  alert(localStorage.getItem("user_name"))
});
Posted by: Guest on May-14-2020
1

javascript localstorage

var KeyName = window.localStorage.key(index);
Posted by: Guest on May-22-2020
0

save to local storage

var cat = localStorage.getItem('myCat');
Posted by: Guest on April-27-2020

Code answers related to "How to use localStorage javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language