pagina 1
Código HTML:
Ver original
<script type="text/javascript"> var frm = document.forms[0]; function guardarDatos(){ localStorage.frm = document.getElementById("frm").value; localStorage.Hacha = document.getElementById("Hacha").value; localStorage.Espia = document.getElementById("Espia").value; localStorage.Lijas = document.getElementById("Lijas").value; localStorage.Ariete = document.getElementById("Ariete").value; localStorage.Catas = document.getElementById("Catas").value; } function recuperarDatos(){ if ((localStorage.frm != undefined) && (localStorage.Hacha != undefined) && (localStorage.Espia != undefined) && (localStorage.Lijas != undefined) && (localStorage.Ariete != undefined) && (localStorage.Catas != undefined)) { document.getElementById("datos").innerHTML = "frm: " + localStorage.frm + "<br/> Hacha: " + localStorage.Hacha + "<br/> Espia: " + localStorage.Espia + "<br/> Lijas: " + localStorage.Lijas + "<br/> Ariete: " + localStorage.Ariete + "<br/> Catas: " + localStorage.Catas; } else{ document.getElementById("datos").innerHTML = "No has introducido datos"; } } </script> </head> <form id="frm" name="gt" method="get" action="confirmar.html" value="frm"> <input type="number" id="Hacha" /> <input type="number" id="Espia" /> <input type="number" id="Ariete" /> <input type="button" onclick="guardarDatos()" value="Guardar datos" /> <input type="button" onclick="recuperarDatos()" value="Recuperar datos" /> <br/> <input id="1" type="submit" value="enviar"/> </form> <script type="text/javascript"> function leer(){ var texto = document.id_frm.id_Hacha.id_Espia. id_Lijas.id_Ariete.id_.Catas.value; localStorage.setItem('frm', texto); localStorage.setItem('Hacha', texto); localStorage.setItem('Espia', texto); localStorage.setItem('Lijas', texto); localStorage.setItem('Ariete', texto); localStorage.setItem('Catas', texto); } </script> </body>