What is htmx?
masterhtmx is a dependency-free JavaScript library that allows you to access modern browser features directly from HTML. It extends the core idea of HTML as hypertext by allowing any element to issue HTTP requests, any event to trigger those requests, any HTTP verb to be used, and any element to be the target of an update.
When using htmx, the server typically responds with HTML rather than JSON, adhering to the Hypertext As The Engine Of Application State (HATEOAS) model.
If you prefer, you can use the data- prefix for all htmx attributes (e.g., data-hx-post="/click") to avoid conflicts with other libraries.
<button hx-post="/clicked"
hx-trigger="click"
hx-target="#parent-div"
hx-swap="outerHTML">
Click Me!
</button>