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

js session storage

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

sessionstorage in javascript

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 :: set port nextjs 
Javascript :: window loaded vanilla javascript 
Javascript :: get selected text of html dropdown in javascript 
Javascript :: javascript change webpage title 
Javascript :: javascript .split().reverse.join 
Javascript :: format time to am pm javascript 
Javascript :: replace an element with another jquery 
Javascript :: onload javascript function call 
Javascript :: bootstrap modal show jquery 
Javascript :: play an audio at a specific volume in javascript 
Javascript :: javascript set target blank 
Javascript :: Factorial of Number in Javascript using Recursive call in javascript 
Javascript :: javascript remove element by id 
Javascript :: remove css inline style javascript 
Javascript :: get last day of month javascript 
Javascript :: find max between 2 numbers javascript 
Javascript :: eslint disalbe check next line 
Javascript :: rimraf node_modules 
Javascript :: jquery select option auto select 
Javascript :: get index pixel of canvas 
Javascript :: javascript select random element from array 
Javascript :: mongodb delete user 
Javascript :: nodejs delete folder recursively 
Javascript :: unable to locate package npm 
Javascript :: javascript button go to url 
Javascript :: fetch with bearer token 
Javascript :: ejs view engine 
Javascript :: noconflict jquery 
Javascript :: js get transition duration 
Javascript :: change label value jquery 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =