cho.sh
HTMX

HTMX

Warning

This post is more than a year old. Information may be outdated.

<button hx-post="/clicked" hx-trigger="click" hx-target="#parent-div" hx-swap="outerHTML">
  Click Me!
</button>

This tells HTMX: "When a user clicks on this button, issue an HTTP POST request to '/clicked' and use the content from the response to replace the element with the id parent-div in the DOM." htmx - Documentation