3 ms·
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 g
by renerick 3y ago
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
https://nitter.net/htmx_org/status/1679966199667478531#m https://nitter.net/htmx_org/status/1679966199667478531#m
- intrasight 3y ago> it addresses a specific shortcoming of HTML: the on* attributes do not support arbitrary events Yes, I saw that. But what does it have to do with XPath?
- renerick 3y agoXPath is implementation detail, used for searching of attributes with a give prefix, and this article is just a public note of how it was done in htmx
- intrasight 3y agoGot it. Thanks.