plain javascript save to localstorage code example
Example: 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');