use localstorage in Js code example
Example 1: javascript store object in local storage
var person = { "name": "billy", "age": 23};
localStorage.setItem('person', JSON.stringify(person));
var retrievedPerson = JSON.parse(localStorage.getItem('person'));
Example 2: how to get data from localstorage in javascript
var data = JSON.parse(localStorage.getItem("key name"));
Example 3: javascript localstorage
var KeyName = window.localStorage.key(index);
Example 4: get localstorage value
localStorage.getItem('bgcolor');