[FR] Attribute to remove target from dom completely.
I am developing an application which inserts many forms into a page as rows. It adheres pretty tightly to CRUD, and HTMX works fantastically for this application.
When creating a new row in the table, a button with hx-get and hx-swap gets the entity type's 'create' form. If the user decides they want to delete the row before saving it, the only way to clear the form using pure htmx is to hx-get an endpoint which returns a blank response. Seems hacky, and I'd much rather see an attribute like hx-remove, hx-blank, or hx-clear, which functions the same as a dummy hx-get to an endpoint which returns a blank response body.
if you use hx-swap="delete" you can use any endpoint with hx-get. This should delete the target regardless of the response. I hope that helps.
I suppose that works, however it still involves an unnecessary request, which if it does not succeed for any reason would cause the target element not to be deleted at all.
Htmx is designed for communication with the server after all, for pure client side logic such as your usecase here, you may use _hyperscript (also by 1cg) or simply use vanilla JS (from what I understand here you'll probably need a single instruction such as a form.reset or element.remove right?)