The current click even is just a more compact way to set up an event handler. However, in practice, we often want access to the effective target (ex: a button rather than a span inside the button). To do this now, we need to use helpers to grab the closest ancestor that matches the original selector (ex: button).
Options:
- Have the
click handler do this for you. Drawback: you might not want that.
- Provide an alternative combinator (ex:
button or navigate). Drawback: confusing?
- Require use of combinators (ex:
closest) to get to the “real” target. Drawback: inexpressive.
The current
clickeven is just a more compact way to set up an event handler. However, in practice, we often want access to the effective target (ex: a button rather than a span inside the button). To do this now, we need to use helpers to grab theclosestancestor that matches the original selector (ex:button).Options:
clickhandler do this for you. Drawback: you might not want that.buttonornavigate). Drawback: confusing?closest) to get to the “real” target. Drawback: inexpressive.