Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



> 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?


XPath 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


Got it. Thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: