Skip to content
This is my space, where experience meets the will to start over. This is my space, where experience meets the will to start over.

The first step is knowing where you want to go.

  • Home
  • Coding Hub
    • Software & Project
      • Small Biz Ops – S.B.O.
        • SmallBizOps – Day 10/90
      • CRM/ERP
      • MyTracker
      • My Budget
    • Form Zero to “WoW”
      • JavaScript from Zero (Completed)
        • 2. Remove and Edit List Items
        • 3. Separate HTML and JavaScript, Use addEventListener and Conditional Logic
        • 4. Add Dynamic CSS Classes
        • 5. Save & Restore Your List with localStorage
        • 6 – Turn Your App into a Full To-Do List
      • Python from Zero (Completed)
        • 2. Lists & Loops
        • 3. Conditional Menus
        • 4. Edit & Remove Tasks (with closing: Python vs PHP and Large Data)
        • 5 – Save to File: Make Your Tasks Survive Restarts
        • 6 — Pythin from zero – Final Project Polishing: Numbering, Formatting, and Preparing for CSV
      • Rust – From Zero to “WoW” (Completed)
        • 1 – Setup and Project Structure in Rust
        • 2 – User input: validation and error handling
        • 3 – Rust from Zero to “WoW – BMI Calculation and Conditional Logic
        • 4 –Rust – Clear, Formatted Output
        • 5 – Rust – Final Thoughts: Precision as a Form of Respect
      • Go from Zero to “WoW” (Completed)
        • 1 – Why Go Is Perfect for a Personal Expense Tracker
        • 2 – Logging Expenses and Console Input
        • 3 – Go from Zero to “WoW” – Smart Filtering & Display Logic
        • 4 – Go – Saving Data to Local Files
        • 5 – Go – Final Project – Expense Tracker in Go
      • C++ from Zero to “WoW” (Completed)
        • 1 – Why C++ for file organization?
        • 2 – C++ – File Type Detection and Classification
        • 3 – C++ – Creating & Managing Subfolders
        • 4 – C++ – Safe File Movement and User Feedback
        • 5 – C++ – Order as Mental Clarity
      • Ubuntu – From Zero to “WoW” (Completed)
        • 2 – Ubuntu – The Desktop Environment and Essential Commands
        • 3 – Ubuntu – Managing Files, Folders, and Permissions
        • 4 – Ubuntu – Installing and Updating Software with APT and Snap
        • 5 – Ubuntu – Customizing the Desktop Environment
        • 6 – Ubuntu – Network and Device Configuration
        • 7 – Ubuntu – User Management & System Security — “The Cathedral of Permissions”
        • 8 – Ubuntu – The Talking Machine: Terminal & Bash Scripting
        • 9 – Ubuntu – Ubuntu as a Server or Development Environment
        • 10 – Ubuntu – Backup, Maintenance & Troubleshooting
    • Git Hub Repository
      • Small Biz Ops – S.B.O.
      • Mini ERP – PHP & MySQL
      • CleverCRM (Java, Spring Boot)
      • FraudWatch (Python, FastAPI + scikit-learn)
      • OnboardIQ – Smart Onboarding Portal (Flask + SQLite Demo)
    • ArchPilot
      • 1-Users & Roles, End-to-End (Architecture, Database, and Cross-Framework Code)
      • 2 – Client Registry (CRM) Across Frameworks
      • 3 – Project & Budget Tracker (ERP)
      • 4 – Approval Workflow Engine Multi-step routing, status tracking, escalation paths
      • 5 – Audit Trail & Versioning
    • Small Biz Ops – S.B.O.
  • Vivere in USA
  • P4Y
  • Testi poetici
    • 1 – Sospeso
    • 2 – Il bicchiere di vetro quieto
    • 3 – Quando l’amore inciampa
    • 4 – Ma chi siete davvero?
    • 5 – Above the Thread of Day
    • 6 – The Truth That Doesn’t Exist
    • 7 – All of You, I Miss
    • 8 – The Captain and the Ocean
    • 9 – Between Light and Mist
    • 10 – Il peso delle scelte
  • Contact
  • Admin
This is my space, where experience meets the will to start over.
This is my space, where experience meets the will to start over.

The first step is knowing where you want to go.

Coding – Step 9 – JavaScript from Scratch – Build Your First Interactive App: The Shopping List

Posted on 22 Luglio 202520 Agosto 2025 By Francesco

Introduction

JavaScript is the language that brings web pages to life. It’s everywhere: websites, apps, games, automation scripts, and even robots.

In this first article, we’ll go beyond the classic alert() — we’ll build a real, functional mini-app using nothing but HTML + CSS + JavaScript.


What We’ll Build

We’ll create a small shopping list app where the user can:

  • Type in a product
  • Click “Add”
  • See the product appear in a list — instantly, without reloading the page

1. HTML – The Structure of the Page

Code:

<h1>My Shopping List</h1>

<input id="item" placeholder="Type a product" />
<button onclick="addItem()">Add</button>

<ul id="list"></ul>

Explanation:

  • <h1>: the page title.
  • <input>: a text field where the user types a product. It has id="item" so JavaScript can access it.
  • <button>: clicking it calls the addItem() function.
  • <ul>: an unordered list, initially empty. Each added product becomes a <li> inside it.

2. JavaScript – The Brain of the Page

Code:

<script>
function addItem() {
// Get the text from the input field
let text = document.getElementById("item").value;

// If empty, do nothing
if (text === "") return;

// Create a new <li> and set its text
let newItem = document.createElement("li");
newItem.textContent = text;

// Add it to the <ul>
document.getElementById("list").appendChild(newItem);

// Clear the input field
document.getElementById("item").value = "";
}
</script>

Explanation:

  • getElementById: selects an element in the page by its id.
  • createElement("li"): creates a new list item.
  • textContent = text: sets its content to what the user typed.
  • appendChild: visually adds the element to the list.
  • Finally, the input field is reset so the user can add another product.

3. CSS – A Touch of Style (Optional)

Code:

<style>
  body { font-family: sans-serif; padding: 20px; }
  input, button { padding: 8px; margin: 6px 0; }
  ul { margin-top: 20px; }
  li { margin: 6px 0; font-weight: bold; }
</style>

4. Test the project

👉 Click here to test the project

Or just copy and paste this code into a file called shopping_list.html and open it in your browser:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shopping List</title>
<style>
body { font-family: sans-serif; padding: 20px; }
input, button { padding: 8px; margin: 6px 0; }
ul { margin-top: 20px; }
li { margin: 6px 0; font-weight: bold; }
</style>
</head>
<body>

<h1>My Shopping List</h1>

<input id="item" placeholder="Type a product" />
<button onclick="addItem()">Add</button>

<ul id="list"></ul>

<script>
function addItem() {
let text = document.getElementById("item").value;
if (text === "") return;

let newItem = document.createElement("li");
newItem.textContent = text;

document.getElementById("list").appendChild(newItem);
document.getElementById("item").value = "";
}
</script>

</body>
</html>

Learning Path: What’s Next?

Here’s a preview of what we’ll build in future lessons. The links will become active as each part is published:

ChapterTopicLink
✅ 1Build your first interactive app (shopping list)You are here!
✅ 2Add a “Remove” button to each itemClick here!
✅ 3Separate HTML and JavaScript, use addEventListenerClick here!
✅ 4Add dynamic CSS classes (e.g., mark items as complete)Click here!
✅ 5Save your list in the browser with localStorageClick here!
✅ 6Turn the app into a full-featured to-do listClick here!

Conclusion

You just built your first real mini-app with JavaScript. No plugins, no frameworks — just clean, native code.

In the next chapters, we’ll improve the app step by step, learning how to:

  • organize your code better
  • add interactive features
  • save data across sessions
  • make your app feel modern and smooth

📩 Want to receive future lessons by email or RSS?
Leave a comment or subscribe to the newsletter!

Post Views: 1.031

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Coding Javascript

Navigazione articoli

Previous post
Next post

Francesco

My name is Francesco Boschi, originally from Italy and currently based in the United States. For over twenty years, I’ve worked as a manager and consultant across diverse sectors — from education and cultural institutions to the food industry — developing skills in operational management, strategic consulting, and complex problem-solving. In recent years, I’ve combined this experience with a strong passion for software development, creating custom tools designed to simplify workflows and meet real business needs.

Relocating to the U.S. marks the beginning of a new chapter: a personal and professional decision driven by the desire to be close to my son and to embrace new challenges in a different environment. Today, my goal is to turn my experience into meaningful solutions, blending strategic vision with technical expertise to help people and organizations work more effectively.

I enjoy moving between different worlds, adapting tools and approaches to people and contexts. I bring leadership, flexibility, attention to detail, analytical thinking, and a strong problem-solving mindset — along with a deep curiosity to learn and grow. Above all, I believe in sharing: I’m always eager to offer my experience to support the growth of others.

Related Posts

Go

Coding – Step 12.2 – Go from Zero to “WoW” – Logging Expenses and Console Input

Posted on 27 Settembre 202527 Settembre 2025

Learn how to capture user input in Go by building a simple expense logger. This beginner-friendly guide shows how to read from the console, validate numbers, and record expenses step by step.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More
Coding

Coding – Step 14.6 – Ubuntu – Network and Device Configuration

Posted on 27 Ottobre 202527 Ottobre 2025

Ubuntu handles connections and devices smoothly, but knowing how to configure Wi-Fi, printers, Bluetooth, and USB manually gives you full control — even as a beginner.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More
Rust

Coding – Step 11.2 – Rust from Zero to “WoW” –User input: validation and error handling

Posted on 27 Settembre 202527 Settembre 2025

Learn how to handle user input in Rust by validating numbers and gracefully managing errors. This chapter of From Zero to “WoW” shows how even a simple BMI calculator can become robust, user-friendly, and safe.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More

Iscriviti alla nostra Newsletter

🤞 Let's keep in touch

We do not send spam! Read our Privacy policy for more information.

Controlla la tua casella di posta o la cartella spam per confermare la tua iscrizione

Cerca nel sito

©2026 This is my space, where experience meets the will to start over. | WordPress Theme by SuperbThemes