Dude, I'll give you a basic example here and hope it helps.
Page you get the value to transfer to another page:
<input type="text" id="texto">
<a href="mostraDados.html"><button type="button" onclick="setaValor()">Pegar</button></a>
<script>
function setaValor() {
var texto = document.getElementById('texto');
var textoValor = texto.value;
var textoStorage = window.localStorage.setItem('valorTexto', textoValor);
}
</script>
<style>
input { border: solid 1px #ccc; border-radius: 2px; height: 20px; }
button { border: solid 1px #ccc; border-radius: 2px; height: 30px; cursor: pointer;}
</style>
Page that receives the page with the value of the previous page:
<input type="text" id="recebeTexto"> Valor trazido da página anterior
<br><br>
<a href="setaDados.html"><button type="button">Voltar</button></a>
<script>
function mostraValor() {
var textoRecebido = window.localStorage.getItem('valorTexto');
document.getElementById('recebeTexto').value = textoRecebido;
}
window.onload = function() {
mostraValor();
};
</script>
<style>
input { border: solid 1px red; border-radius: 2px; height: 20px; }
button { border: solid 1px #ccc; border-radius: 2px; height: 30px; cursor: pointer;}
</style>