0
I’m studying about local Storage in HTML5 and JS, understanding that its purpose is to store texts in the local Storage of browser.
When testing, I got JS errors. I’d like to understand better why:
<script type="text/javascript">
function exibir(){
document.getElementById("nome").value = localStorage.getItem("l_nome");
}
</script>
<body onload="exibir();">
<form>
Nome: <input type="text" id="nome">
<input type="button" onclick="salvar();" value="Save">
</form>
</body>
Where is your method
salvar
? The error is that it was not set. There is no error withlocalStorage
.– Wakim