AnteFil,
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
document.addEventListener("DOMContentLoaded", function() {
let k = JSON.parse(localStorage.item || "[]");
const inp = document.querySelectorAll('input.item');
const fn = (elem, i) => {
if (k[i] !== void(0)) elem.value = k[i];
elem.addEventListener("input", _ => {
k[i] = elem.value;
localStorage.item = JSON.stringify(k);
})
};
inp.forEach(fn);
});
</script>
</head>
<body>
<input type="text" size="40" class="item">
<input type="text" size="40" class="item">
<input type="text" size="40" class="item">
<input type="text" size="40" class="item">
<input type="text" size="40" class="item">
<input type="submit" value="Отправить">
</body>
</html>