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

> Possible method 1: Data attributes. Any time you as an author want to add additional data to an element, you are free to invent any custom attribute names you want, so long as they begin with "data-".

From the linked docs:

> It's worth mentioning that, if you prefer, you can use the data- prefix when using htmx:

    <a data-hx-post="/click">Click Me!</a>


Why promote and illustrate a non-standard way, or even allow it at all?


For those people that like to have less verbosity at the expense of composing invalid HTML?

TypeScript is an invalid form of JS but people still like it.




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

Search: