Created
March 11, 2025 16:58
-
-
Save arashnm80/18a5b437e3ddfcd991a626d612d928c5 to your computer and use it in GitHub Desktop.
simple notes website that read/write data on localStorage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Offline Notes App</title> | |
| <style> | |
| body { font-family: Arial, sans-serif; max-width: 500px; margin: auto; padding: 20px; } | |
| textarea { width: 100%; height: 200px; } | |
| button { margin-top: 10px; padding: 10px; } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Offline Notes</h2> | |
| <textarea id="noteInput" placeholder="Write your notes here..."></textarea> | |
| <button onclick="saveNote()">Save Note</button> | |
| <script> | |
| // Load saved note from LocalStorage when page loads | |
| document.getElementById('noteInput').value = localStorage.getItem('userNote') || ''; | |
| function saveNote() { | |
| let note = document.getElementById('noteInput').value; | |
| localStorage.setItem('userNote', note); | |
| alert('Note saved!'); | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment