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

what is local storage and session storage in javascript

//localStorage - stores data with no expiration date. window. sessionStorage - stores data for one session (data is lost when the browser tab is closed)
Comment

PREVIOUS NEXT
Code Example
Javascript :: empty input of clone jquery 
Javascript :: javascript separate string by char 
Javascript :: send data from one page to another html page in Javascript 
Javascript :: javascript remove last element from array 
Javascript :: declare empty object javascript 
Javascript :: view background image in react native 
Javascript :: count array in javascript 
Javascript :: nextjs change port 
Javascript :: how to change the choose file button text in react 
Javascript :: getting form values in javascript 
Javascript :: dom element get attribute 
Javascript :: javascript style multiple properties 
Javascript :: placeholder value javascript 
Javascript :: nextsibling vs nextelementsibling 
Javascript :: crop image canvas 
Javascript :: insert item into array specific index javascript 
Javascript :: js toggle class 
Javascript :: how to check if a json object is empty 
Javascript :: how to access form values in react 
Javascript :: javascript orderby 
Javascript :: how to set cookies in node js 
Javascript :: lodash toLower 
Javascript :: react change state async 
Javascript :: check date in between two dates nodejs 
Javascript :: moment js - to find if dates are same by day 
Javascript :: dociql process.env.NODE_TLS_REJECT_UNAUTHORIZED=0 
Javascript :: link button material ui 
Javascript :: today date js 
Javascript :: vue js countdown timer 
Javascript :: dayofweek javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =