Is " /> Is " /> Is "/>

With HTMX, can I filter the html that's returned from the server?

56 Views Asked by At

For reasons, my server will often return html that's wrapped in a containing div:

<div class="useless-container">
   <!-- the actual juice -->
</div>

Is there a way to set up a filter in HTMX which I can use to modify the html, i.e. to reduce the containing div?

1

There are 1 best solutions below

4
mariodev On BEST ANSWER

Yes. Take a look at hx-select.

The hx-select attribute allows you to select the content you want swapped from a response.