All 35 Bugs /
0/35 Fixed ✓
JavaScriptEasy~8 min

Event Delegation e.target Child Span Click Bug

What's Broken (Symptom)

Clicking the icon `<span>` inside an action `<button>` breaks `e.target.dataset.action` because `e.target` points to the inner `<span>`.

Expected Behavior

  • • Resolve the owning button with `e.target.closest("[data-action]")` inside the delegated click listener.

Debugging Hints (0/2 used)

Try spotting the bug in the editor first. Need a nudge? Reveal Hint 1 anytime.

Root Cause Breakdown

Pass all 1 automated verification checks on the right to unlock the full Root Cause explanation.

Automated Bug Verification

1 Checks Ready
  • Captures action even when clicking inner icon spanClicking delete icon sets picked to delete.
bugfix.html
Live Sandboxed PreviewCtrl + Enter to verify
Console Output0 log(s)
No console output yet. Run Preview or Verify Bug Fix.