This is a simple and interactive To-Do List application that allows users to add, mark as completed, and remove tasks. The tasks are stored in the browser's local storage, ensuring they persist across sessions.
- Add new tasks to the list.
- Mark tasks as completed by clicking on them.
- Remove tasks by clicking the close (×) button.
- Persist tasks using local storage so that tasks are saved even after refreshing the page.
- HTML
- CSS
- JavaScript
-
Clone the repository to your local machine:
git clone https://github.com/ianand3977/to-do-list.git
-
Navigate to the project directory:
cd to-do-list
-
Open
index.html
in your preferred browser. -
Add your tasks using the input box and click the "Add" button to save them.
The HTML file creates the basic structure of the To-Do List app, including the input box, add button, and the list container where tasks are displayed.
The CSS file styles the To-Do List app, making it visually appealing and user-friendly. It includes styles for the container, input box, buttons, and list items.
The JavaScript file contains the core functionality of the To-Do List app. It includes functions to add tasks, mark them as completed, remove tasks, and save/load tasks to/from local storage.
- addTask(): Adds a new task to the list. If the input box is empty, it alerts the user to enter a task.
- saveData(): Saves the current list of tasks to local storage.
- showTask(): Loads tasks from local storage when the page is loaded or refreshed.
- Event Listeners: Handles click events on list items and close buttons to mark tasks as completed or remove them, respectively.
The app uses the browser's local storage to save tasks, ensuring that tasks persist even after the page is refreshed. This is handled by the saveData()
and showTask()
functions.
If you'd like to contribute to this project, please fork the repository and create a pull request with your changes.