Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Register a single event handler on a parent element rather than individual handlers on each child. The handler inspects the event target's attributes (such as action and id) to determine which child was clicked and responds accordingly.
DOM events bubble up from child to parent, so a single parent handler can intercept all child events. This reduces memory usage and automatically handles dynamically added children.
Updated Feb 2026