Answers for "how can i save in local storage in js"

2

js save local storage

//Set item
localStorage.setItem('myCat', 'Tom');
//Get item
var cat = localStorage.getItem("myCat");
//Remove item
localStorage.removeItem("lastname");
//Remove all items
localStorage.clear();
Posted by: Guest on May-08-2021
5

save to local storage

localStorage.setItem('myCat', 'Tom');

var cat = localStorage.getItem('myCat');

localStorage.removeItem('myCat');

// Clear all items
localStorage.clear();
Posted by: Guest on April-27-2020
0

save to local storage

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

Code answers related to "how can i save in local storage in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language