save in localstorage
This commit is contained in:
parent
8d7926e55e
commit
165e39ed7e
10
index.html
10
index.html
@ -27,4 +27,14 @@
|
||||
</head>
|
||||
|
||||
<textarea></textarea>
|
||||
|
||||
<script>
|
||||
var txt = document.querySelector('textarea');
|
||||
|
||||
txt.value = localStorage.getItem('text') || '';
|
||||
|
||||
txt.addEventListener('keydown', function(e) {
|
||||
localStorage.setItem('text', txt.value);
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user