How do I resolve the error: [object HTMLInputElement]
The code should save the typed text in the field, and even giving F5 get saved, eg: same as the script for that site.
function digGet(){
// Cria um item "usuario" com valor "Thiago Belem"
var login = document.getElementById("user_login");
window.localStorage.setItem('usuario', login);
saveGet();
}
function saveGet(){
// Depois, em outra página ou aba, recupera esse item
var usuario = window.localStorage.getItem('usuario');
document.getElementById('user_login').value = usuario;
}
function delGet(){
// Remove o item
window.localStorage.removeItem('usuario');
}
//Rodar no load do DOM
document.addEventListener("DOMContentLoaded", function(event){
saveGet();
});