sessionstorage on domcontentloaded javascript

Solutions on MaxInterview for sessionstorage on domcontentloaded javascript by the best coders in the world

showing results for - "sessionstorage on domcontentloaded javascript"
Christopher
20 Jul 2018
1nameInput.addEventListener("input", () => {
2  sessionStorage.setItem("name", nameInput.value);
3});
4
5emailInput.addEventListener("input", () => {
6  sessionStorage.setItem("email", emailInput.value);
7});
8
9msgInput.addEventListener("input", () => {
10  sessionStorage.setItem("message", msgInput.value);
11});
12
13document.addEventListener("DOMContentLoaded", () => {
14  nameInput.value = sessionStorage.getItem("name");
15  emailInput.value = sessionStorage.getItem("email");
16  msgInput.value = sessionStorage.getItem("message");
17});
similar questions