Learn JavaScript basics by building a to-do list
Six half-hour sessions built on MDN, the web's standard free reference. You'll build one page step by step until it's a to-do list that adds, checks off, deletes, and remembers tasks.
Outcome
A working to-do list page in plain HTML, CSS, and JavaScript: add tasks, check them off, delete them, see a live count, and keep everything after a reload.
- Every resource is a real public page our team picked. Our server checks the links; if one ever breaks, tell us and we'll replace it.
- localStorage keeps tasks only in that one browser on that one device. Clearing browsing data erases them.
- Some browsers handle storage differently for pages opened straight from a file. If tasks don't survive a reload, try Chrome or Firefox, or serve the folder with a local server such as the VS Code Live Server extension.
- This journey uses plain JavaScript with no frameworks, on purpose, so you learn what frameworks do for you later.
- 10,000 seconds is a structured starting point. It builds a real first result, not guaranteed expertise.
Outline
- 127:47
Build the page and connect your script
A to-do page opens in your browser and its script prints to the console.
- 227:47
React when the user adds a task
Pressing Add or Enter reads what was typed, without reloading the page.
- 327:47
Show tasks on the page
Each new task appears as a list item on the page.
- 427:47
Check off and delete tasks
Each task has a checkbox that crosses it out and a Delete button that removes it.
- 527:46
Remember tasks after a reload
Store tasks as an array of objects and save and load them with localStorage.
- 627:46
Capstone: the finished to-do list
A to-do list where you can add, check off, and delete tasks, with a live counter, that survives a page reload.
Capstone
Your working to-do list
A to-do list web page in plain HTML, CSS, and JavaScript that adds, checks off, and deletes tasks, shows how many are left, saves to localStorage, and includes one improvement you designed.
Sources
- Arrays
MDN Web Docs (Mozilla)
Not yet verifiedFree - <input type="checkbox">
MDN Web Docs (Mozilla)
Not yet verifiedFree - Element: classList property
MDN Web Docs (Mozilla)
Not yet verifiedFree - Creating the content
MDN Web Docs (Mozilla)
Not yet verifiedFree - DOM scripting introduction
MDN Web Docs (Mozilla)
Not yet verifiedFree - Introduction to events
MDN Web Docs (Mozilla)
Not yet verifiedFree - Functions: reusable blocks of code
MDN Web Docs (Mozilla)
Not yet verifiedFree - Using the Web Storage API
MDN Web Docs (Mozilla)
Not yet verifiedFree - What is JavaScript?
MDN Web Docs (Mozilla)
Not yet verifiedFree