Answers for "how to save data on local storage"

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

local storage in vanila javascript

// Store data
var someData = 'The data that I want to store for later.';
localStorage.setItem('myDataKey', someData);

// Get data
var data = localStorage.getItem('myDataKey');

// Remove data
localStorage.removeItem('myDatakey');
Posted by: Guest on May-25-2020
0

save to local storage

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

Code answers related to "how to save data on local storage"

Code answers related to "Javascript"

Browse Popular Code Answers by Language