5 ms·
If I understood correctly, you can achive this with `hx-target` and `hx-select` - I'm doing this in an app to replace an editor content based on which link is c
by pondidum 3y ago
If I understood correctly, you can achive this with `hx-target` and `hx-select` - I'm doing this in an app to replace an editor content based on which link is clicked.
- https://htmx.org/attributes/hx-select/ https://htmx.org/attributes/hx-select/
- https://htmx.org/attributes/hx-target/ https://htmx.org/attributes/hx-target/
- quickthrower2 3y agoThat could be it! I missed that one. Will try it next time.
- sethammons 3y agoOh that's neat - so you can return more than htmx will use and it can select the element it needs in the response and discard the rest
- joshmanders 3y agoYep, I actually don't even do server side checks in my app I am building, I just hx-boost on my html element and then server side I redirect back to the page that should have the updated content, just like you would a traditional server rendered app, and htmx then swaps out the body, but if I use target and that I can tell it to only return say the `<main>` tag and maybe another part of the page, the rest doesn't change.