1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<!DOCTYPE html> <script> function setSessionStorageValue(key, value) { window.sessionStorage[key] = value; } function getSessionStorageValue(key) { return window.sessionStorage[key] || ""; } function setLocalStorageValue(key, value) { window.localStorage[key] = value; } function getLocalStorageValue(key) { return window.localStorage[key] || ""; } </script>