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-target/
- https://htmx.org/attributes/hx-select/ - https://htmx.org/attributes/hx-target/