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 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 :: vuejs 
Javascript :: google places API details JS 
Javascript :: create a class variable js 
Javascript :: anonymous function 
Javascript :: javascript numbers 
Javascript :: asp net core use newtonsoft json 
Javascript :: clear cache javascript 
Javascript :: type js 
Javascript :: react create context 
Javascript :: Lazy Loading 
Javascript :: remove duplicates array javascript 
Javascript :: history of react js 
Javascript :: how to download json object that come from backend in react 
Javascript :: object.assign 
Javascript :: javascript how to select a array 
Javascript :: node.js folder structure 
Javascript :: javascript eliminar saltos de linea textarea 
Javascript :: data table buttons 
Javascript :: sequelize find query to return raw data in json object format 
Javascript :: javascript merge multidimensional array 
Javascript :: how to clear nodejs terminal in vs code 
Javascript :: js upload file size limit 
Javascript :: initiate node js app 
Javascript :: row append and calculation in jquery datatable 
Javascript :: javascript replace class tailwindcss 
Javascript :: dual array javascript 
Javascript :: java.lang.UnsupportedOperationException: JsonObject 
Javascript :: activate router angular 
Javascript :: circle collision javascript 
Javascript :: jquery-3.5.1.min.js download 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =