Chapter 6 — DOM Manipulation

New concepts: getElementById, createElement, innerHTML, classList, addEventListener

Open the browser Console (F12 → Console) to see output from console.log().

Exercises

  1. Create a table from the sales data array and append to #output
  2. Add a filter button: click → show only Delivered orders in the table
  3. Add a sort button: click → re-sort table by total descending
  4. Colour rows by status: green=Delivered, yellow=Shipped, blue=Pending, red=Cancelled