My First JavaScript DOM Project

What I Built, What I Broke, and What I Learned

When I first heard the phrase “DOM Manipulation,” I thought it sounded like something out of a sci-fi movie.
Turns out, it’s just a fancy way of saying “changing stuff on a webpage with JavaScript.” As someone who’s just getting started with coding, this concept felt a little intimidating.
But now?
I just built my first DOM project—and I’m proud.

What I Built

I created a simple social media-like interface where a user can:

  1. View a list of posts
  2. Click a button to “like” a post
  3. Add a new post using a form
  4. Delete a post (goodbye, cringey content!)

It wasn’t Facebook or Instagram, but it was mine and it worked. Mostly.

What I Learned

  1. JavaScript can actually make a page come alive.
    At first, HTML felt like drawing on paper. But once I added JavaScript and connected it to my HTML with document.querySelector, addEventListener, and appendChild, the page started responding to clicks and input. That’s when it clicked—this is real programming.

  2. Mistakes are part of the journey.
    I forgot to call preventDefault() on my form submission, so the page kept reloading every time I added a post. It took me a while (and a few frustrated sighs) to realize what was wrong. But when I fixed it, I felt like a genius.

  3. Fetching data feels like magic.
    I used a local db.json file with a fake server and got to practice fetch() to get and display posts. At first, the promise syntax confused me. But once I broke it down and saw it work, it felt powerful.

Beginner Tip

If you’re just starting out, don’t worry about making it perfect. My code was messy. My console was full of red errors. But every single bug taught me something valuable.

What’s Next

I plan to revisit this project later and refactor my code, maybe even try to style it better with CSS. I also want to learn how to add images to posts and maybe store data in a real database.

Final Thoughts

This project taught me that learning to code is not about being perfect it’s about being curious and persistent. DOM manipulation isn’t scary anymore. It’s fun. And this is just the beginning.

IT’S FUN.

Similar Posts