how to save in phonelocalstorage using javascript code example
Example 1: store data in localstorage javascript
var testObject = { 'one': 1, 'two': 2, 'three': 3 };
localStorage.setItem('testObject', JSON.stringify(testObject));
var retrievedObject = localStorage.getItem('testObject');
console.log('retrievedObject: ', JSON.parse(retrievedObject));
Example 2: local storage in vanila javascript
var someData = 'The data that I want to store for later.';
localStorage.setItem('myDataKey', someData);
var data = localStorage.getItem('myDataKey');
localStorage.removeItem('myDatakey');