A tiny local practice app for DOM manipulation interviews: type real JavaScript, run it against a sandboxed page, and get tests.
From the clawd workspace:
cd /home/dallin/clawd/dom-trainer
# any simple static server works; pick one
npx --yes serve .
# or
python3 -m http.server 8080Then open the printed URL (e.g. http://localhost:3000 or :8080).
- querySelector / getElementById
- addEventListener (click, keydown Enter)
- input.value → Number(...) → Number.isFinite
- textContent updates
- createElement + appendChild
- innerHTML clear-and-rebuild
- array ops: push, pop, includes, reduce
Edit challenges.js and add another object to the challenges array.
Each test is a function that can click buttons, set input values, and assert DOM state.