Project Introduction
The Notes App is a JavaScript project that allows users to create, edit, search and delete personal notes. Notes are stored in the browser using Local Storage.
Learn how to build a modern Notes App using JavaScript, DOM manipulation and Local Storage.
In this project, you will learn how to create, edit, search and delete notes. All notes will be saved inside the browser using Local Storage, so they remain available after refreshing the page.
The Notes App is a JavaScript project that allows users to create, edit, search and delete personal notes. Notes are stored in the browser using Local Storage.
Create the main page with a notes heading, note input area, title field, content field, save button and a section where saved notes will be displayed.
Create an input field for the note title. The title helps the user quickly identify the purpose of each saved note.
Use a textarea for the note content so users can write longer information, ideas, reminders or study notes.
Store notes inside a JavaScript array. Each note can contain a unique id, title, content and creation date.
Create a function that reads the title and content, validates the input and adds a new note object to the notes array.
Use DOM manipulation to create note cards dynamically and display the saved notes on the webpage.
Give every note a unique id and use the id to find and remove the selected note from the notes array.
When the user chooses Edit, load the selected note's title and content into the form, then update the existing note after saving.
Use the search input and the filter() method to find notes whose title or content contains the entered search text.
Use localStorage.setItem() to save the notes array as JSON so that notes remain available after refreshing the browser.
Use localStorage.getItem() when the application starts and JSON.parse() to convert saved JSON data back into a JavaScript array.
Use the JavaScript Date object to store the date and time when a note is created or updated.
Create a function that removes all notes from the array and clears the saved notes from Local Storage.
The complete flow is: Enter Note → Validate Input → Add or Update Note → Save Array → Display Notes → Store in Local Storage → Search, Edit or Delete when required.
After understanding each step, open the complete Notes App and create, edit, search and delete different notes.
const note = {
id: Date.now(),
title: "My First Note",
content: "Learn JavaScript",
date: new Date().toLocaleString()
};
notes.push(note);
localStorage.setItem(
"aifa_notes",
JSON.stringify(notes)
);
const savedNotes =
localStorage.getItem("aifa_notes");
const notes =
savedNotes
? JSON.parse(savedNotes)
: [];
const results = notes.filter(note =>
note.title
.toLowerCase()
.includes(searchText) ||
note.content
.toLowerCase()
.includes(searchText)
);
Create Note → Validate → Save Note → Display Note → Store in Local Storage → Search → Edit → Delete