Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

sessionStorage on DOMContentLoaded javascript

nameInput.addEventListener("input", () => {
  sessionStorage.setItem("name", nameInput.value);
});

emailInput.addEventListener("input", () => {
  sessionStorage.setItem("email", emailInput.value);
});

msgInput.addEventListener("input", () => {
  sessionStorage.setItem("message", msgInput.value);
});

document.addEventListener("DOMContentLoaded", () => {
  nameInput.value = sessionStorage.getItem("name");
  emailInput.value = sessionStorage.getItem("email");
  msgInput.value = sessionStorage.getItem("message");
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: Subscription field must return Async Iterable. Received: undefined. 
Javascript :: javascript reduce array of objects group by property 
Javascript :: how to disable gravity for an object in matter.js 
Javascript :: declarar function javascript 
Javascript :: filtering buttons parseint javascript 
Javascript :: count number of vowels in a string javascript 
Javascript :: enzyme to json 
Javascript :: module scope javascript 
Javascript :: babel 7 ReferenceError: regeneratorRuntime 
Javascript :: js unslick 
Javascript :: initializing a property asynchronously 
Javascript :: discord.js v13 afk command 
Javascript :: staticDir storybook svg and images not loading 
Javascript :: javascript range setstart 
Javascript :: generate history logs 
Javascript :: release mouse key javascript 
Javascript :: mongo look for substring of field 
Javascript :: Javascript Reverse Words O(n) time O(1) space 
Javascript :: how to put value in arrar 
Javascript :: SHOPIFY CUSTOMER WITH REGISTRATION 
Javascript :: prepare webpack-ready 
Javascript :: decrypt javascript code 
Javascript :: js array map and update tat array value 
Javascript :: joining two array 
Javascript :: How to Use the Return Keyword in a Function 
Javascript :: send data to another page javascript 
Javascript :: removing the first match in array 
Javascript :: js template literal without white spaces 
Javascript :: javascript reduce mdn 
Javascript :: convert js to tsx 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =