Skip to main content Accessibility Feedback

Browser Storage


Use the local storage API to store data locally that the browser can access later. Data is stored indefinitely, and must be a string.

// 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

Find this useful? You can support my work by purchasing an annual membership.