Specify multiple targets to swap
See original GitHub issueThis is a related note to this: https://github.com/bigskysoftware/htmx/issues/26
And I appreciate possibly a hard ask, but…
I understand how the oob feature lets me return multiple containers that can get injected into the page, but this requires architecting my app such that it only returns fragments in response to an htmx request. However I would prefer to always send a single, full-page HTML response, and leave it to the front-end to pick and choose what to inject or discard.
For example if I’m building a store, and I want a user to be able to add an item to their cart, there are at least 2 DIVs in the response that I’d like to select & inject; a flash/notice confirming the add, and an update to the cart icon along my navigation bar.
I’m curious to hear your thoughts on this scenario. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:21 (12 by maintainers)

Top Related StackOverflow Question
Any progress on this…?
The whole point of htmx is so we can write less javascript.