0
I am trying to pass the value of an input from one page to fill another input on another page using HTML5 sessionStorage, I would like to know why this code is not working.
//função que captura o valor de um input na página 1
function valor(){
var email = document.getElementById('email');
var emailValor = email.value;
var teste = window.localStorage.setItem('valor', emailValor);
console.log(emailValor);
}
valor();
//função que mostra o valor em outro input na página 2
function mostraValor(){
var data = window.localeStorage.getItem('valor');
document.getElementById('email').value = data;
console.log(data);
}
mostraValor();
what’s going wrong?
– mercador
Pages are in the same domain?
– jefissu
Yes, they are in the same domain, I do not know what is going wrong, because the console shows no error.
– LeAndrade