When I run the javascript, it runs normally, my question was, how do I get the code now from that table that the script has changed.
When I run the javascript, it runs normally, my question was, how do I get the code now from that table that the script has changed.
Using HTML5 Local Storage you can save text from textarea locally, so even if you close the file the values will be there.
Code:
<!DOCTYPE html>
<html>
<body>
<html><table><textarea id='result'>Escreva aqui seu lembrete</textarea></table></html>
<button onClick="salvar()">Salvar</button>
<script>
function salvar() {
// Check browser support
if (typeof(Storage) !== "undefined") {
// Store
localStorage.setItem("text", document.getElementById("result").value);
} else {
document.getElementById("result").innerHTML = "Local Storage não suportado";
}
}
// Retrieve
document.getElementById("result").innerHTML = localStorage.getItem("text");
</script>
</body>
</html>
JS Fiddle: link