Code to go logo
Created using Figma
Use Cases
Contribute
How to add item to localstorage in JavaScript
Storage
By Jad Joubran ·
Last updated Dec 19, 2017
const name = "John"; localStorage.setItem("name", name);
Dec 19, 2017
1
Jad Joubran
See answer
1
Jad Joubran
Window.localStorage
on MDN
Learn JavaScript step by step
Related use cases
How to add object to localstorage in JavaScript
How to remove item from localstorage in JavaScript
How to get item from localstorage in JavaScript