Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to set session storage in javascript

// Save data to sessionStorage
sessionStorage.setItem('key', 'value');

// Get saved data from sessionStorage
let data = sessionStorage.getItem('key');

// Remove saved data from sessionStorage
sessionStorage.removeItem('key');

// Remove all saved data from sessionStorage
sessionStorage.clear();
Comment

javascript sessionStorage

	var setsession = window.sessionStorage.setItem("animals", "cat");
	var getsession = window.sessionStorage.getItem("animals");
	console.log(getsession);
Comment

js session storage

sessionStorage.setItem('mode','dark');
const mode = sessionStorage.getItem('mode');
console.log(mode); // 'dark'
Comment

sessionstorage in js

sessionStorage.setItem("user-name", $("#signup-name").val());
let name = sessionStorage.getItem("user-name");
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript eval alternative 
Javascript :: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 
Javascript :: js change object value 
Javascript :: javascript closures 
Javascript :: enhanced object literals in es6 
Javascript :: take one character in end of string javascript 
Javascript :: js detect end of array 
Javascript :: multiple images on cloudinary 
Javascript :: / w/g in javascript 
Javascript :: node 
Javascript :: java script alerts 
Javascript :: arrow function javascript rules 
Javascript :: Iterating or loop through the elements of an array is with a for loop (for): 
Javascript :: javascript stack 
Javascript :: JS how to access a class propert 
Javascript :: js opposite of includes 
Javascript :: how to rerender a page in React when the user clicks the back button 
Javascript :: query selector js 
Javascript :: javascript unicode 
Javascript :: how to assign dynamic value to variable in javascript 
Javascript :: angular store select method 
Javascript :: use index of an array within a for loop 
Javascript :: javascript get width of image 
Javascript :: instanceof 
Javascript :: how we can set react select required 
Javascript :: destructuring an array 
Javascript :: filter table search 
Javascript :: node js file extension 
Javascript :: react native notifications error 
Javascript :: redux workflow 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =