Answers for "get local storage value in javascript"

23

local storage javascript

function createItem() {
	localStorage.setItem('nameOfItem', 'value'); 
} 
createItem() // Creates a item named 'nameOfItem' and stores a value of 'value'

function getValue() {
	return localStorage.getItem('nameOfItem');  
} // Gets the value of 'nameOfItem' and returns it
console.log(getValue()); //'value';
Posted by: Guest on April-26-2020
4

javascript get local storage

var Item = localStorage.getItem('youritem');
Posted by: Guest on February-22-2020
0

how to get variable in local storage in javascript

localStorage.getItem('id');
Posted by: Guest on February-28-2020

Code answers related to "get local storage value in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language