Practice · 2 of 2
Delegated Dashboard Events
CHALLENGE
Difficulty: advanced+25 XP
Model event delegation WITHOUT the DOM. Write createDelegator(onToggle) returning { wire, click } — wire(el, id) registers an element under a task id; click(target) simulates a click on target: if target is a registered element, call onToggle(id) for its CURRENT state, flip that state, and return true; unknown targets return false and do nothing. State per id starts at false (not done).
Press Submit to check your solution.
Back to lesson: Practice: Dashboard Mini-Build