Skip to content

Set hx-put attribute value use hyperscript dynamically not work as expected. #2574

Answered by Telroshan
zw963 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, htmx indeed parses the attributes on load, so it parses the blank hx-put. For any situation where you want to update some htmx logic "from the outside" (for instance updating an attribute value after it has been parsed, inserting a node outside htmx's own swapping system), you will want to use htmx.process, after setting your new hx-put value.
This should make htmx process the new hx-put value correctly here.
Let me know!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zw963
Comment options

@zw963
Comment options

Answer selected by zw963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants