JAVASCRIPT PROJECT 15

Notes App

Learn how to build a modern Notes App using JavaScript, DOM manipulation and Local Storage.

About This Project

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.

01

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.

02

HTML Structure

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.

03

Note Title

Create an input field for the note title. The title helps the user quickly identify the purpose of each saved note.

04

Note Content

Use a textarea for the note content so users can write longer information, ideas, reminders or study notes.

05

Notes Array

Store notes inside a JavaScript array. Each note can contain a unique id, title, content and creation date.

06

Adding a Note

Create a function that reads the title and content, validates the input and adds a new note object to the notes array.

07

Displaying Notes

Use DOM manipulation to create note cards dynamically and display the saved notes on the webpage.

08

Deleting Notes

Give every note a unique id and use the id to find and remove the selected note from the notes array.

09

Editing Notes

When the user chooses Edit, load the selected note's title and content into the form, then update the existing note after saving.

10

Searching Notes

Use the search input and the filter() method to find notes whose title or content contains the entered search text.

11

Local Storage

Use localStorage.setItem() to save the notes array as JSON so that notes remain available after refreshing the browser.

12

Loading Saved Notes

Use localStorage.getItem() when the application starts and JSON.parse() to convert saved JSON data back into a JavaScript array.

13

Date and Time

Use the JavaScript Date object to store the date and time when a note is created or updated.

14

Clear All Notes

Create a function that removes all notes from the array and clears the saved notes from Local Storage.

15

Project Flow

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.

16

Complete Project

After understanding each step, open the complete Notes App and create, edit, search and delete different notes.

Basic Note Object

const note = {
    id: Date.now(),
    title: "My First Note",
    content: "Learn JavaScript",
    date: new Date().toLocaleString()
};

notes.push(note);

Saving Notes to Local Storage

localStorage.setItem(
    "aifa_notes",
    JSON.stringify(notes)
);

const savedNotes =
    localStorage.getItem("aifa_notes");

const notes =
    savedNotes
        ? JSON.parse(savedNotes)
        : [];

Searching Notes

const results = notes.filter(note =>
    note.title
        .toLowerCase()
        .includes(searchText) ||

    note.content
        .toLowerCase()
        .includes(searchText)
);

Project Flow

Create Note → Validate → Save Note → Display Note → Store in Local Storage → Search → Edit → Delete

Run Complete Project → ← Back to Projects