Lesson 4.7 · Flip the Class
Four tiny apps. One stretch game. Three new tools.
Click a card to open the worked version of each challenge.
C1
Red Mode
Two buttons flip every bit of text on the page between black and red — a class-flip theme toggle.
classList.add · classList.remove C2The Great Box Popper
Ten numbered boxes, ten numbered buttons. Each button vanishes its matching box.
classList.add · display: none C3Pop and Reappear
Pop a box, the red button hides and a green RETURN appears. Both reverse on click.
two-way classList toggle C4Choose Your Style
A three-question quiz that flips the palette, swaps the image, and rewrites the caption.
classList · .src · .textContent · localStorage━━ Level 2 — Stretch ━━