by rprenger · 3y ago · 0 comments
It took a decade for JQuery to be nearly completely absorbed by browser standards.
https://gist.github.com/1cg/d1ad1ddd5f43a8a993cd9f711135edc9
Here is an example button using these proposed extensions to HTML
<button href="/example"
method="patch"
target="#divToReplace"
onClick="this.submit()">
This is an example button hypermedia control
</button>If everything and anything is clickable, how does technology that supports accessibility handle that? Note: This isn't a way-a-figure-you-fool question. Not at all. It's a sincere question in the sense that accessibility matters, we can't forget that. So if we change, how can we be certain accessibility isn't left behind?
https://htmx.org/attributes/hx-trigger/
w/ an explicit and declarative syntax, but that attribute is fairly involved
this was a brief exercise in thinking about the minimal changes necessary to HTML to support something like htmx, and unfortunately there isn't any attribute that maps to hx-trigger in the same way there is for other htmx attributes, so I resorted to the on* attributes + generalizing the submit() function on forms.
Or am I incorrect?
HTML elements shouldn't do POSTs, that's why JavaScript exists. <form> and <a> are elements that do HTTP requests but the same can be added to any other html or custom element. html integration with JS doesn't need another layer.