save in localstorage
This commit is contained in:
parent
8d7926e55e
commit
165e39ed7e
10
index.html
10
index.html
@ -27,4 +27,14 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<textarea></textarea>
|
<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>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user