Because HTML's on* attributes are not generic, they are hardcoded in the spec, you can't use them to handle arbitrary events. hx-on is an attempt to fill this gap for simple cases, when managing event listeners manually or resorting to _hyperscript or alpine is too much
> it addresses a specific shortcoming of HTML: the on* attributes do not support arbitrary events
> it is much less featureful & useful than, for example, @Alpine_JS, but if you have very basic needs for event handling it can help avoid another dependency
> it addresses a specific shortcoming of HTML: the on* attributes do not support arbitrary events
> it is much less featureful & useful than, for example, @Alpine_JS, but if you have very basic needs for event handling it can help avoid another dependency
https://nitter.net/htmx_org/status/1679966199667478531#m