Skip to content

About

15+ HTML, CSS, and JavaScript projects for beginners, each running live next to its code and a plain-words walkthrough of the ideas behind it.

Topics

Resources

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

JavaScript Projects for Beginners

HTML, CSS, and JavaScript projects you can run, read, and learn from in the browser, from a counter to a quote app that calls an API.

Live site License: MIT

JavaScript Projects for Beginners: learn by building real things

I built this so beginners can learn JavaScript the way it's actually used: by building the small, familiar parts of real websites. Every project runs live on its page, next to its full code and a walkthrough of the ideas behind it, so you can see what it does, read how it's done, and copy it to build on.

Use the site

On the live site, start from the path, which lists every project by level. Each level has its own page with what it covers, what to know before you start, and its projects.

Each project page opens with a banner: what you're building, your progress, and a link to the project's article when it has one. Under it, Why build it names what you can build with these skills, and Skills you'll earn lists what you'll be able to do afterwards. Then come three parts:

  • Try it: the project running in a playground you can resize to phone, tablet, or desktop width, next to its HTML, CSS, and JavaScript. Turn the teaching comments off, copy a file, or download the whole project.
  • How it works: the ideas behind it, one at a time, each explained in plain words next to the lines of code that use it. Select Find it in the full code to highlight those lines in the playground.
  • Wrap up: challenges to try on your own, other articles on the blog that cover the project's ideas, and the project's own article in the blog series, which goes into each idea in more depth.

Some projects are built more than one way, like an accordion with no JavaScript and one that keeps a single answer open, so you can compare them. A switcher above the playground and the walkthrough moves between the ways. Tick ideas off as you learn them and mark projects done; your progress is saved in your browser, with no account needed.

Every project and level page has a Share button for sending the page to someone. When you finish a project, a level, or all of them, Share it draws a card of your progress in your browser, with your name on it if you add one, ready to download, copy, or share.

What it teaches

The projects are ordered from simple to advanced, in three levels:

Level Projects Focus
Beginner Counter, Color Flipper, Accordion, Modal Box, Tabs Events and the DOM
Intermediate Image Slider, Carousel, Calculator, Countdown Timer, To-do List, Search Filter Arrays, state, and timing
Advanced Form Validation, Quiz App, Expense Tracker, Random Quote Forms, data, and APIs

Every project is plain HTML, CSS, and JavaScript, with no libraries, and covers accessibility as it goes: keyboard support, focus, and what screen readers announce.

Run it locally

You need Node.js 20.9 or later and pnpm. Clone the repo and install:

git clone https://github.com/Timonwa/javascript-projects-for-beginners.git
cd javascript-projects-for-beginners
pnpm install

Then start the dev server and open the URL it prints, usually http://localhost:3000:

pnpm dev

Before the server starts, pnpm dev copies every project's files into public/demos/ so the playground can run them.

Scripts

Command What it does
pnpm dev Copies the demos, then starts the dev server
pnpm build Copies the demos, then builds every page as static HTML
pnpm start Serves the production build
pnpm lint Runs ESLint
pnpm typecheck Checks the types without building
pnpm format Formats the code with Prettier
pnpm format:check Checks formatting without changing files

The only setting is optional: set APP_ENV=production to load analytics. Leave it unset locally so your own visits aren't counted.

Project structure

Folder What it holds
src/content/projects/ The projects: each one's files and its project.md
app/ The pages, plus the sitemap, share images, and llms.txt
src/components/ The interface, with shared pieces in ui/
src/lib/ Config, data, types and schemas, loaders, and SEO helpers
scripts/build-demos.mjs Copies each project into public/demos/ and zips it for download

More projects like these

Contributing

Spotted a bug or a mistake in an explanation? Open an issue. Pull requests that fix a reported bug are welcome; new projects and new content aren't being taken.

License

MIT © Timonwa Akintokun

About

15+ HTML, CSS, and JavaScript projects for beginners, each running live next to its code and a plain-words walkthrough of the ideas behind it.

Topics

Resources

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages