htmx
htmx copied to clipboard
Can you select content from the fetched HTML before swapping?
Hello! Happy holidays.
Is it possible to have selectors on the HTML content you want to swap from a response?
I see that we can use selectors to tell HTMX where we want it to swap in the current DOM, but what about that of the fetched HTML?
Hello! Happy holidays to you too.
I think hx-select can be used for your usecase, it can be used to only swap in part of the response (using selectors). It is the 'opposite' of hx-target which tells HTMX where to put the response.
@itepastra That was it!! Thank you for your help, really enjoy the philosophy behind htmx.