Есть 3 инпута, надо сохранить их значения в localStorage
. Все три поля не может сохранить почему-то:
var txt = document.getElementById("1");
txt.value = localStorage["1"] || "";
window.go = function() {
localStorage["1"] = txt.value;
}
var txt = document.getElementById("2");
txt.value = localStorage["2"] || "";
window.go = function() {
localStorage["2"] = txt.value;
}
var txt = document.getElementById("3");
txt.value = localStorage["3"] || "";
window.go = function() {
localStorage["3"] = txt.value;
}
<input id="1">
<input id="2">
<input id="3">