-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes.html
39 lines (36 loc) · 1022 Bytes
/
notes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Notepad</title>
<style>
body {
font-family: Arial, sans-serif;
}
textarea {
width: 100%;
height: 400px;
}
</style>
</head>
<body>
<h1>Simple Notepad</h1>
<textarea id="notepad-content"></textarea>
<script>
const notepadContent = document.getElementById('notepad-content');
// Load saved content from Local Storage (if available)
window.onload = function () {
const savedContent = localStorage.getItem('notepadContent');
if (savedContent) {
notepadContent.value = savedContent;
}
};
// Save content to Local Storage whenever there is a change
notepadContent.addEventListener('input', function () {
const content = notepadContent.value;
localStorage.setItem('notepadContent', content);
});
</script>
</body>
</html>