SessionStorage na 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");
});
inbloom